summaryrefslogtreecommitdiffstats
path: root/freebsd/lib
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-20 15:53:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:39 +0200
commit18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d (patch)
treea3020ac5b1f366f2f0920941b589808e435dbcee /freebsd/lib
parentUpdate to FreeBSD head 2017-12-01 (diff)
downloadrtems-libbsd-18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d.tar.bz2
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4. Update #3472.
Diffstat (limited to 'freebsd/lib')
-rw-r--r--freebsd/lib/libc/include/isc/eventlib.h4
-rw-r--r--freebsd/lib/libc/include/isc/list.h4
-rw-r--r--freebsd/lib/libc/include/isc/platform.h4
-rw-r--r--freebsd/lib/libc/include/reentrant.h2
-rw-r--r--freebsd/lib/libc/inet/inet_addr.c2
-rw-r--r--freebsd/lib/libc/inet/inet_cidr_ntop.c4
-rw-r--r--freebsd/lib/libc/inet/inet_cidr_pton.c4
-rw-r--r--freebsd/lib/libc/inet/inet_net_ntop.c4
-rw-r--r--freebsd/lib/libc/inet/inet_net_pton.c4
-rw-r--r--freebsd/lib/libc/inet/inet_neta.c4
-rw-r--r--freebsd/lib/libc/inet/inet_ntop.c4
-rw-r--r--freebsd/lib/libc/inet/inet_pton.c4
-rw-r--r--freebsd/lib/libc/inet/nsap_addr.c4
-rw-r--r--freebsd/lib/libc/isc/ev_streams.c4
-rw-r--r--freebsd/lib/libc/isc/ev_timers.c4
-rw-r--r--freebsd/lib/libc/isc/eventlib_p.h4
-rw-r--r--freebsd/lib/libc/nameser/ns_name.c4
-rw-r--r--freebsd/lib/libc/nameser/ns_netint.c4
-rw-r--r--freebsd/lib/libc/nameser/ns_parse.c4
-rw-r--r--freebsd/lib/libc/nameser/ns_print.c4
-rw-r--r--freebsd/lib/libc/nameser/ns_samedomain.c4
-rw-r--r--freebsd/lib/libc/nameser/ns_ttl.c4
-rw-r--r--freebsd/lib/libc/net/getaddrinfo.c3
-rw-r--r--freebsd/lib/libc/net/getifaddrs.c4
-rw-r--r--freebsd/lib/libc/net/if_indextoname.c2
-rw-r--r--freebsd/lib/libc/net/if_nameindex.c2
-rw-r--r--freebsd/lib/libc/net/if_nametoindex.c2
-rw-r--r--freebsd/lib/libc/net/rcmd.c4
-rw-r--r--freebsd/lib/libc/resolv/herror.c2
-rw-r--r--freebsd/lib/libc/resolv/res_comp.c2
-rw-r--r--freebsd/lib/libc/resolv/res_data.c4
-rw-r--r--freebsd/lib/libc/resolv/res_debug.c6
-rw-r--r--freebsd/lib/libc/resolv/res_debug.h6
-rw-r--r--freebsd/lib/libc/resolv/res_findzonecut.c4
-rw-r--r--freebsd/lib/libc/resolv/res_init.c2
-rw-r--r--freebsd/lib/libc/resolv/res_mkquery.c6
-rw-r--r--freebsd/lib/libc/resolv/res_mkupdate.c4
-rw-r--r--freebsd/lib/libc/resolv/res_query.c2
-rw-r--r--freebsd/lib/libc/resolv/res_send.c2
-rw-r--r--freebsd/lib/libc/resolv/res_update.c4
-rw-r--r--freebsd/lib/libcasper/libcasper/libcasper.h14
-rw-r--r--freebsd/lib/libmemstat/memstat_uma.c26
-rw-r--r--freebsd/lib/libutil/humanize_number.c3
43 files changed, 138 insertions, 50 deletions
diff --git a/freebsd/lib/libc/include/isc/eventlib.h b/freebsd/lib/libc/include/isc/eventlib.h
index a4cfdf90..7e10063a 100644
--- a/freebsd/lib/libc/include/isc/eventlib.h
+++ b/freebsd/lib/libc/include/isc/eventlib.h
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/include/isc/list.h b/freebsd/lib/libc/include/isc/list.h
index ffd0c511..cdc98a84 100644
--- a/freebsd/lib/libc/include/isc/list.h
+++ b/freebsd/lib/libc/include/isc/list.h
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1997,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/include/isc/platform.h b/freebsd/lib/libc/include/isc/platform.h
index a0513be8..b514cb42 100644
--- a/freebsd/lib/libc/include/isc/platform.h
+++ b/freebsd/lib/libc/include/isc/platform.h
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
diff --git a/freebsd/lib/libc/include/reentrant.h b/freebsd/lib/libc/include/reentrant.h
index dd197ada..69132d0e 100644
--- a/freebsd/lib/libc/include/reentrant.h
+++ b/freebsd/lib/libc/include/reentrant.h
@@ -67,7 +67,7 @@
* Implementation Details:
*
* The mutex primitives used by the library (mutex_t, mutex_lock, etc.)
- * are macros which expand to the cooresponding primitives provided by
+ * are macros which expand to the corresponding primitives provided by
* the thread engine or to nothing. The latter is used so that code is
* not unreasonably cluttered with #ifdefs when all thread safe support
* is removed.
diff --git a/freebsd/lib/libc/inet/inet_addr.c b/freebsd/lib/libc/inet/inet_addr.c
index 3dedd7fa..5d8f5f1a 100644
--- a/freebsd/lib/libc/inet/inet_addr.c
+++ b/freebsd/lib/libc/inet/inet_addr.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/lib/libc/inet/inet_cidr_ntop.c b/freebsd/lib/libc/inet/inet_cidr_ntop.c
index 1fccb9a4..771e3331 100644
--- a/freebsd/lib/libc/inet/inet_cidr_ntop.c
+++ b/freebsd/lib/libc/inet/inet_cidr_ntop.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_cidr_pton.c b/freebsd/lib/libc/inet/inet_cidr_pton.c
index 2165b898..d19894ae 100644
--- a/freebsd/lib/libc/inet/inet_cidr_pton.c
+++ b/freebsd/lib/libc/inet/inet_cidr_pton.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_net_ntop.c b/freebsd/lib/libc/inet/inet_net_ntop.c
index 48b1fd07..2932d269 100644
--- a/freebsd/lib/libc/inet/inet_net_ntop.c
+++ b/freebsd/lib/libc/inet/inet_net_ntop.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_net_pton.c b/freebsd/lib/libc/inet/inet_net_pton.c
index ba59726f..7fbf5da6 100644
--- a/freebsd/lib/libc/inet/inet_net_pton.c
+++ b/freebsd/lib/libc/inet/inet_net_pton.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1996, 1998, 1999, 2001, 2003 Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_neta.c b/freebsd/lib/libc/inet/inet_neta.c
index aa02ec59..498f5e20 100644
--- a/freebsd/lib/libc/inet/inet_neta.c
+++ b/freebsd/lib/libc/inet/inet_neta.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_ntop.c b/freebsd/lib/libc/inet/inet_ntop.c
index be2aabe2..cbc59f1e 100644
--- a/freebsd/lib/libc/inet/inet_ntop.c
+++ b/freebsd/lib/libc/inet/inet_ntop.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/inet_pton.c b/freebsd/lib/libc/inet/inet_pton.c
index 18bcd32b..ddaa6c28 100644
--- a/freebsd/lib/libc/inet/inet_pton.c
+++ b/freebsd/lib/libc/inet/inet_pton.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/inet/nsap_addr.c b/freebsd/lib/libc/inet/nsap_addr.c
index 27449b42..f6bda82e 100644
--- a/freebsd/lib/libc/inet/nsap_addr.c
+++ b/freebsd/lib/libc/inet/nsap_addr.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/isc/ev_streams.c b/freebsd/lib/libc/isc/ev_streams.c
index 92af0c87..65ca8039 100644
--- a/freebsd/lib/libc/isc/ev_streams.c
+++ b/freebsd/lib/libc/isc/ev_streams.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium
*
diff --git a/freebsd/lib/libc/isc/ev_timers.c b/freebsd/lib/libc/isc/ev_timers.c
index 56efe06f..380b5686 100644
--- a/freebsd/lib/libc/isc/ev_timers.c
+++ b/freebsd/lib/libc/isc/ev_timers.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium
*
diff --git a/freebsd/lib/libc/isc/eventlib_p.h b/freebsd/lib/libc/isc/eventlib_p.h
index 07db816f..a56334f0 100644
--- a/freebsd/lib/libc/isc/eventlib_p.h
+++ b/freebsd/lib/libc/isc/eventlib_p.h
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium
*
diff --git a/freebsd/lib/libc/nameser/ns_name.c b/freebsd/lib/libc/nameser/ns_name.c
index 224f9512..50946fab 100644
--- a/freebsd/lib/libc/nameser/ns_name.c
+++ b/freebsd/lib/libc/nameser/ns_name.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/nameser/ns_netint.c b/freebsd/lib/libc/nameser/ns_netint.c
index 887bdc44..08927f3d 100644
--- a/freebsd/lib/libc/nameser/ns_netint.c
+++ b/freebsd/lib/libc/nameser/ns_netint.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/nameser/ns_parse.c b/freebsd/lib/libc/nameser/ns_parse.c
index 6b3f68c6..06854350 100644
--- a/freebsd/lib/libc/nameser/ns_parse.c
+++ b/freebsd/lib/libc/nameser/ns_parse.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/nameser/ns_print.c b/freebsd/lib/libc/nameser/ns_print.c
index 99427348..da620aa0 100644
--- a/freebsd/lib/libc/nameser/ns_print.c
+++ b/freebsd/lib/libc/nameser/ns_print.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/nameser/ns_samedomain.c b/freebsd/lib/libc/nameser/ns_samedomain.c
index 754e23b9..281bfb74 100644
--- a/freebsd/lib/libc/nameser/ns_samedomain.c
+++ b/freebsd/lib/libc/nameser/ns_samedomain.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/nameser/ns_ttl.c b/freebsd/lib/libc/nameser/ns_ttl.c
index 5a5aa169..f4e2f9f9 100644
--- a/freebsd/lib/libc/nameser/ns_ttl.c
+++ b/freebsd/lib/libc/nameser/ns_ttl.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/net/getaddrinfo.c b/freebsd/lib/libc/net/getaddrinfo.c
index c9dab725..8ad66043 100644
--- a/freebsd/lib/libc/net/getaddrinfo.c
+++ b/freebsd/lib/libc/net/getaddrinfo.c
@@ -1279,7 +1279,8 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
* does not accept. So we need to separate the case for
* AF_INET.
*/
- if (inet_aton(hostname, (struct in_addr *)pton) != 1)
+ if (inet_aton(hostname, (struct in_addr *)pton) != 1 ||
+ hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0')
return 0;
p = pton;
break;
diff --git a/freebsd/lib/libc/net/getifaddrs.c b/freebsd/lib/libc/net/getifaddrs.c
index 7e111a68..f8bbaf5c 100644
--- a/freebsd/lib/libc/net/getifaddrs.c
+++ b/freebsd/lib/libc/net/getifaddrs.c
@@ -2,7 +2,9 @@
/* $KAME: getifaddrs.c,v 1.9 2001/08/20 02:31:20 itojun Exp $ */
-/*
+/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
* Copyright (c) 1995, 1999
* Berkeley Software Design, Inc. All rights reserved.
*
diff --git a/freebsd/lib/libc/net/if_indextoname.c b/freebsd/lib/libc/net/if_indextoname.c
index 236ccbda..9299286c 100644
--- a/freebsd/lib/libc/net/if_indextoname.c
+++ b/freebsd/lib/libc/net/if_indextoname.c
@@ -3,6 +3,8 @@
/* $KAME: if_indextoname.c,v 1.7 2000/11/08 03:09:30 itojun Exp $ */
/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*
diff --git a/freebsd/lib/libc/net/if_nameindex.c b/freebsd/lib/libc/net/if_nameindex.c
index 6d2573e8..b2ef9d7f 100644
--- a/freebsd/lib/libc/net/if_nameindex.c
+++ b/freebsd/lib/libc/net/if_nameindex.c
@@ -3,6 +3,8 @@
/* $KAME: if_nameindex.c,v 1.8 2000/11/24 08:20:01 itojun Exp $ */
/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*
diff --git a/freebsd/lib/libc/net/if_nametoindex.c b/freebsd/lib/libc/net/if_nametoindex.c
index 92a2abed..01d3a573 100644
--- a/freebsd/lib/libc/net/if_nametoindex.c
+++ b/freebsd/lib/libc/net/if_nametoindex.c
@@ -3,6 +3,8 @@
/* $KAME: if_nametoindex.c,v 1.6 2000/11/24 08:18:54 itojun Exp $ */
/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*
diff --git a/freebsd/lib/libc/net/rcmd.c b/freebsd/lib/libc/net/rcmd.c
index 24bd7a0c..bc6a583d 100644
--- a/freebsd/lib/libc/net/rcmd.c
+++ b/freebsd/lib/libc/net/rcmd.c
@@ -459,8 +459,8 @@ again:
first = 0;
if ((pwd = getpwnam(luser)) == NULL)
return (-1);
- (void)strcpy(pbuf, pwd->pw_dir);
- (void)strcat(pbuf, "/.rhosts");
+ (void)strlcpy(pbuf, pwd->pw_dir, sizeof(pbuf));
+ (void)strlcat(pbuf, "/.rhosts", sizeof(pbuf));
/*
* Change effective uid while opening .rhosts. If root and
diff --git a/freebsd/lib/libc/resolv/herror.c b/freebsd/lib/libc/resolv/herror.c
index 29da9ca3..013d1619 100644
--- a/freebsd/lib/libc/resolv/herror.c
+++ b/freebsd/lib/libc/resolv/herror.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/lib/libc/resolv/res_comp.c b/freebsd/lib/libc/resolv/res_comp.c
index 4999327b..f3db9b95 100644
--- a/freebsd/lib/libc/resolv/res_comp.c
+++ b/freebsd/lib/libc/resolv/res_comp.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/lib/libc/resolv/res_data.c b/freebsd/lib/libc/resolv/res_data.c
index d17412de..12f66f39 100644
--- a/freebsd/lib/libc/resolv/res_data.c
+++ b/freebsd/lib/libc/resolv/res_data.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/resolv/res_debug.c b/freebsd/lib/libc/resolv/res_debug.c
index 004a7db0..12cb6e7f 100644
--- a/freebsd/lib/libc/resolv/res_debug.c
+++ b/freebsd/lib/libc/resolv/res_debug.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: (ISC AND BSD-3-Clause)
+ *
* Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2003 Internet Software Consortium.
*
@@ -18,8 +20,6 @@
*/
/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
* Copyright (c) 1985
* The Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/lib/libc/resolv/res_debug.h b/freebsd/lib/libc/resolv/res_debug.h
index c28171d7..088046ad 100644
--- a/freebsd/lib/libc/resolv/res_debug.h
+++ b/freebsd/lib/libc/resolv/res_debug.h
@@ -1,4 +1,6 @@
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999 by Internet Software Consortium.
*
@@ -13,6 +15,8 @@
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
*/
#ifndef _RES_DEBUG_H_
diff --git a/freebsd/lib/libc/resolv/res_findzonecut.c b/freebsd/lib/libc/resolv/res_findzonecut.c
index acb3186f..8cf8c554 100644
--- a/freebsd/lib/libc/resolv/res_findzonecut.c
+++ b/freebsd/lib/libc/resolv/res_findzonecut.c
@@ -4,7 +4,9 @@
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2005/10/11 00:10:16 marka Exp $";
#endif /* not lint */
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/resolv/res_init.c b/freebsd/lib/libc/resolv/res_init.c
index ce4b4267..815313c0 100644
--- a/freebsd/lib/libc/resolv/res_init.c
+++ b/freebsd/lib/libc/resolv/res_init.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1985, 1989, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/lib/libc/resolv/res_mkquery.c b/freebsd/lib/libc/resolv/res_mkquery.c
index 564eb5a2..dd2e94b2 100644
--- a/freebsd/lib/libc/resolv/res_mkquery.c
+++ b/freebsd/lib/libc/resolv/res_mkquery.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: (ISC AND BSD-3-Clause)
+ *
* Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996, 1997, 1988, 1999, 2001, 2003 Internet Software Consortium.
*
@@ -18,8 +20,6 @@
*/
/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/lib/libc/resolv/res_mkupdate.c b/freebsd/lib/libc/resolv/res_mkupdate.c
index c737bc87..69a77f64 100644
--- a/freebsd/lib/libc/resolv/res_mkupdate.c
+++ b/freebsd/lib/libc/resolv/res_mkupdate.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libc/resolv/res_query.c b/freebsd/lib/libc/resolv/res_query.c
index 2010d647..2071970d 100644
--- a/freebsd/lib/libc/resolv/res_query.c
+++ b/freebsd/lib/libc/resolv/res_query.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2001, 2003 Internet Software Consortium.
diff --git a/freebsd/lib/libc/resolv/res_send.c b/freebsd/lib/libc/resolv/res_send.c
index 06d11327..b635c558 100644
--- a/freebsd/lib/libc/resolv/res_send.c
+++ b/freebsd/lib/libc/resolv/res_send.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2003 Internet Software Consortium.
diff --git a/freebsd/lib/libc/resolv/res_update.c b/freebsd/lib/libc/resolv/res_update.c
index d4df045c..55a761f3 100644
--- a/freebsd/lib/libc/resolv/res_update.c
+++ b/freebsd/lib/libc/resolv/res_update.c
@@ -4,7 +4,9 @@
static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/04/27 04:56:43 sra Exp $";
#endif /* not lint */
-/*
+/*-
+ * SPDX-License-Identifier: ISC
+ *
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
diff --git a/freebsd/lib/libcasper/libcasper/libcasper.h b/freebsd/lib/libcasper/libcasper/libcasper.h
index 8ad15bc6..6e1bfdba 100644
--- a/freebsd/lib/libcasper/libcasper/libcasper.h
+++ b/freebsd/lib/libcasper/libcasper/libcasper.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2012-2013 The FreeBSD Foundation
* Copyright (c) 2015-2017 Mariusz Zaborski <oshogbo@FreeBSD.org>
* All rights reserved.
@@ -122,7 +124,15 @@ cap_wrap(int sock)
#ifdef WITH_CASPER
int cap_unwrap(cap_channel_t *chan);
#else
-#define cap_unwrap(chan) (chan->cch_fd)
+static inline int
+cap_unwrap(cap_channel_t *chan)
+{
+ int fd;
+
+ fd = chan->cch_fd;
+ free(chan);
+ return (fd);
+}
#endif
/*
@@ -222,7 +232,7 @@ int cap_send_nvlist(const cap_channel_t *chan, const nvlist_t *nvl);
#ifdef WITH_CASPER
nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, int flags);
#else
-#define cap_recv_nvlist(chan, flags) (0)
+#define cap_recv_nvlist(chan, flags) (nvlist_create(flags))
#endif
/*
diff --git a/freebsd/lib/libmemstat/memstat_uma.c b/freebsd/lib/libmemstat/memstat_uma.c
index 533a5af7..249335b3 100644
--- a/freebsd/lib/libmemstat/memstat_uma.c
+++ b/freebsd/lib/libmemstat/memstat_uma.c
@@ -57,6 +57,8 @@ static struct nlist namelist[] = {
{ .n_name = "_mp_maxid" },
#define X_ALL_CPUS 2
{ .n_name = "_all_cpus" },
+#define X_VM_NDOMAINS 3
+ { .n_name = "_vm_ndomains" },
{ .n_name = "" },
};
@@ -300,11 +302,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
{
LIST_HEAD(, uma_keg) uma_kegs;
struct memory_type *mtp;
+ struct uma_zone_domain uzd;
struct uma_bucket *ubp, ub;
struct uma_cache *ucp, *ucp_array;
struct uma_zone *uzp, uz;
struct uma_keg *kzp, kz;
- int hint_dontsearch, i, mp_maxid, ret;
+ int hint_dontsearch, i, mp_maxid, ndomains, ret;
char name[MEMTYPE_MAXNAME];
cpuset_t all_cpus;
long cpusetsize;
@@ -326,6 +329,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
list->mtl_error = ret;
return (-1);
}
+ ret = kread_symbol(kvm, X_VM_NDOMAINS, &ndomains,
+ sizeof(ndomains), 0);
+ if (ret != 0) {
+ list->mtl_error = ret;
+ return (-1);
+ }
ret = kread_symbol(kvm, X_UMA_KEGS, &uma_kegs, sizeof(uma_kegs), 0);
if (ret != 0) {
list->mtl_error = ret;
@@ -450,10 +459,17 @@ skip_percpu:
kz.uk_ipers;
mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
- for (ubp = LIST_FIRST(&uz.uz_buckets); ubp !=
- NULL; ubp = LIST_NEXT(&ub, ub_link)) {
- ret = kread(kvm, ubp, &ub, sizeof(ub), 0);
- mtp->mt_zonefree += ub.ub_cnt;
+ for (i = 0; i < ndomains; i++) {
+ ret = kread(kvm, &uz.uz_domain[i], &uzd,
+ sizeof(uzd), 0);
+ for (ubp =
+ LIST_FIRST(&uzd.uzd_buckets);
+ ubp != NULL;
+ ubp = LIST_NEXT(&ub, ub_link)) {
+ ret = kread(kvm, ubp, &ub,
+ sizeof(ub), 0);
+ mtp->mt_zonefree += ub.ub_cnt;
+ }
}
if (!((kz.uk_flags & UMA_ZONE_SECONDARY) &&
LIST_FIRST(&kz.uk_zones) != uzp)) {
diff --git a/freebsd/lib/libutil/humanize_number.c b/freebsd/lib/libutil/humanize_number.c
index 40668aa9..109b4f6a 100644
--- a/freebsd/lib/libutil/humanize_number.c
+++ b/freebsd/lib/libutil/humanize_number.c
@@ -147,7 +147,8 @@ humanize_number(char *buf, size_t len, int64_t quotient,
*/
for (i = 0;
(quotient >= max || (quotient == max - 1 &&
- remainder >= divisordeccut)) && i < maxscale; i++) {
+ (remainder >= divisordeccut || remainder >=
+ divisor / 2))) && i < maxscale; i++) {
remainder = quotient % divisor;
quotient /= divisor;
}