aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-02-11 14:04:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-11 14:04:18 +0000
commit1a36faad54665288ed4eb839d2a4699ae2ead45e (patch)
treed70718667dce07140839f680f261f409c9f95c83 /lib
parent5ca5951e319b1b495c758be73ec21ba7bc73a912 (diff)
parent07569d55334c6221ee70333030883bba9185978d (diff)
downloadsrc-1a36faad54665288ed4eb839d2a4699ae2ead45e.tar.gz
src-1a36faad54665288ed4eb839d2a4699ae2ead45e.zip
Merge ^/head r313301 through r313643.
Notes
Notes: svn path=/projects/clang400-import/; revision=313644
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/hcreate.38
-rw-r--r--lib/libc/tests/hash/Makefile3
-rw-r--r--lib/libc/tests/regex/Makefile3
-rw-r--r--lib/libc/tests/stdio/printbasic_test.c22
-rw-r--r--lib/libc/tests/stdio/printfloat_test.c19
-rw-r--r--lib/libipsec/pfkey.c14
-rw-r--r--lib/libipsec/pfkey_dump.c40
-rw-r--r--lib/libnetbsd/glob.h39
-rw-r--r--lib/libnetbsd/pthread.h36
-rw-r--r--lib/libnetbsd/sha1.h3
-rw-r--r--lib/libnetbsd/sha2.h1
-rw-r--r--lib/libnetbsd/sys/event.h42
-rw-r--r--lib/libnetbsd/sys/types.h37
-rw-r--r--lib/libnetbsd/sys/wait.h37
-rw-r--r--lib/libnetbsd/util.h7
-rw-r--r--lib/libstand/stand.h1
-rw-r--r--lib/libstand/ufs.c2
-rw-r--r--lib/libutil/Makefile11
-rw-r--r--lib/libutil/hexdump.35
19 files changed, 276 insertions, 54 deletions
diff --git a/lib/libc/stdlib/hcreate.3 b/lib/libc/stdlib/hcreate.3
index 57091570dcb6..260aa91b6c7d 100644
--- a/lib/libc/stdlib/hcreate.3
+++ b/lib/libc/stdlib/hcreate.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 26, 2015
+.Dd February 6, 2017
.Dt HCREATE 3
.Os
.Sh NAME
@@ -265,9 +265,9 @@ main(void)
.Ed
.Sh ERRORS
The
-.Fn hcreate
+.Fn hcreate ,
.Fn hcreate_r ,
-.Fn hsearch
+.Fn hsearch ,
and
.Fn hsearch_r
functions will fail if:
@@ -281,7 +281,7 @@ The
and
.Fn hsearch_r
functions will also fail if the action is
-.Dv SEARCH
+.Dv FIND
and the element is not found:
.Bl -tag -width Er
.It Bq Er ESRCH
diff --git a/lib/libc/tests/hash/Makefile b/lib/libc/tests/hash/Makefile
index 1e2cd29dbddf..7811d455cdc3 100644
--- a/lib/libc/tests/hash/Makefile
+++ b/lib/libc/tests/hash/Makefile
@@ -32,8 +32,7 @@ ${PACKAGE}DATA_FILES+= data/sha1test2-out
LIBADD+= md
LIBADD.sha2_test+= crypto
-CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh/openbsd-compat
-CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh
+CFLAGS.h_hash+= -I${SRCTOP}/lib/libnetbsd
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/regex/Makefile b/lib/libc/tests/regex/Makefile
index c4f43512623d..b16f503c65f1 100644
--- a/lib/libc/tests/regex/Makefile
+++ b/lib/libc/tests/regex/Makefile
@@ -6,7 +6,8 @@ PACKAGE= tests
BINDIR= ${TESTSDIR}
-IMPLEMENTATION?= -DREGEX_SPENCER
+# SKIP_LEFTASSOC -> these testcases fail on FreeBSD.
+IMPLEMENTATION?= -DREGEX_SPENCER -DSKIP_LEFTASSOC
CFLAGS.h_regex+=-I${TESTSRC} -I${.CURDIR:H:H}/regex
PROGS+= h_regex
diff --git a/lib/libc/tests/stdio/printbasic_test.c b/lib/libc/tests/stdio/printbasic_test.c
index 7f7c6cbbd65c..322e7477da25 100644
--- a/lib/libc/tests/stdio/printbasic_test.c
+++ b/lib/libc/tests/stdio/printbasic_test.c
@@ -78,22 +78,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
va_copy(ap2, ap);
smash_stack();
vsnprintf(s, sizeof(s), fmt, ap);
- if (strcmp(result, s) != 0) {
- atf_tc_fail(
- "printf(\"%s\", %s) ==> [%s], expected [%s]",
- fmt, argstr, s, result);
- }
+ ATF_CHECK_MSG(strcmp(result, s) == 0,
+ "printf(\"%s\", %s) ==> [%s], expected [%s]",
+ fmt, argstr, s, result);
smash_stack();
mbstowcs(ws, s, BUF - 1);
mbstowcs(wfmt, fmt, BUF - 1);
mbstowcs(wresult, result, BUF - 1);
vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2);
- if (wcscmp(wresult, ws) != 0) {
- atf_tc_fail(
- "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
- wfmt, argstr, ws, wresult);
- }
+ ATF_CHECK_MSG(wcscmp(wresult, ws) == 0,
+ "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
+ wfmt, argstr, ws, wresult);
+
va_end(ap);
va_end(ap2);
}
@@ -114,6 +111,11 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt("-1", "%jd", (intmax_t)-1);
testfmt(S_UINT64MAX, "%ju", UINT64_MAX);
+ if (sizeof(ptrdiff_t) != sizeof(uintmax_t))
+ atf_tc_expect_fail("the %%t qualifier is broken on 32-bit "
+ "platforms where there's a mismatch between ptrdiff_t and "
+ "uintmax_t's type width; bug # 191674");
+
testfmt("-1", "%td", (ptrdiff_t)-1);
testfmt(S_SIZEMAX, "%tu", (size_t)-1);
diff --git a/lib/libc/tests/stdio/printfloat_test.c b/lib/libc/tests/stdio/printfloat_test.c
index 974374fae5ca..97629fb0d2b1 100644
--- a/lib/libc/tests/stdio/printfloat_test.c
+++ b/lib/libc/tests/stdio/printfloat_test.c
@@ -70,22 +70,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
va_copy(ap2, ap);
smash_stack();
vsnprintf(s, sizeof(s), fmt, ap);
- if (strcmp(result, s) != 0) {
- atf_tc_fail(
- "printf(\"%s\", %s) ==> [%s], expected [%s]",
- fmt, argstr, s, result);
- }
+ ATF_CHECK_MSG(strcmp(result, s) == 0,
+ "printf(\"%s\", %s) ==> [%s], expected [%s]",
+ fmt, argstr, s, result);
smash_stack();
mbstowcs(ws, s, BUF - 1);
mbstowcs(wfmt, fmt, BUF - 1);
mbstowcs(wresult, result, BUF - 1);
vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2);
- if (wcscmp(wresult, ws) != 0) {
- atf_tc_fail(
- "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
- wfmt, argstr, ws, wresult);
- }
+ ATF_CHECK_MSG(wcscmp(wresult, ws) == 0,
+ "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]",
+ wfmt, argstr, ws, wresult);
+
va_end(ap);
va_end(ap2);
}
@@ -318,7 +315,7 @@ ATF_TC_BODY(hexadecimal_floating_point, tc)
testfmt("0x1p-1074", "%a", 0x1p-1074);
testfmt("0x1.2345p-1024", "%a", 0x1.2345p-1024);
-#if (LDBL_MANT_DIG == 64) && !defined(__i386__)
+#if (LDBL_MANT_DIG == 64)
testfmt("0x1.921fb54442d18468p+1", "%La", 0x3.243f6a8885a308dp0L);
testfmt("0x1p-16445", "%La", 0x1p-16445L);
testfmt("0x1.30ecap-16381", "%La", 0x9.8765p-16384L);
diff --git a/lib/libipsec/pfkey.c b/lib/libipsec/pfkey.c
index fe907b394960..34a3ac300989 100644
--- a/lib/libipsec/pfkey.c
+++ b/lib/libipsec/pfkey.c
@@ -1776,21 +1776,17 @@ pfkey_align(msg, mhp)
case SADB_EXT_SPIRANGE:
case SADB_X_EXT_POLICY:
case SADB_X_EXT_SA2:
- case SADB_X_EXT_SA_REPLAY:
- mhp[ext->sadb_ext_type] = (caddr_t)ext;
- break;
case SADB_X_EXT_NAT_T_TYPE:
case SADB_X_EXT_NAT_T_SPORT:
case SADB_X_EXT_NAT_T_DPORT:
- /* case SADB_X_EXT_NAT_T_OA: is OAI */
case SADB_X_EXT_NAT_T_OAI:
case SADB_X_EXT_NAT_T_OAR:
case SADB_X_EXT_NAT_T_FRAG:
- if (feature_present("ipsec_natt")) {
- mhp[ext->sadb_ext_type] = (caddr_t)ext;
- break;
- }
- /* FALLTHROUGH */
+ case SADB_X_EXT_SA_REPLAY:
+ case SADB_X_EXT_NEW_ADDRESS_SRC:
+ case SADB_X_EXT_NEW_ADDRESS_DST:
+ mhp[ext->sadb_ext_type] = (caddr_t)ext;
+ break;
default:
__ipsec_errcode = EIPSEC_INVAL_EXTTYPE;
return -1;
diff --git a/lib/libipsec/pfkey_dump.c b/lib/libipsec/pfkey_dump.c
index 04df27ea07b1..83a003405ca3 100644
--- a/lib/libipsec/pfkey_dump.c
+++ b/lib/libipsec/pfkey_dump.c
@@ -220,6 +220,9 @@ pfkey_sadump(m)
struct sadb_ident *m_sid, *m_did;
struct sadb_sens *m_sens;
struct sadb_x_sa_replay *m_sa_replay;
+ struct sadb_x_nat_t_type *natt_type;
+ struct sadb_x_nat_t_port *natt_sport, *natt_dport;
+ struct sadb_address *natt_oai, *natt_oar;
/* check pfkey message. */
if (pfkey_align(m, mhp)) {
@@ -245,33 +248,46 @@ pfkey_sadump(m)
m_did = (struct sadb_ident *)mhp[SADB_EXT_IDENTITY_DST];
m_sens = (struct sadb_sens *)mhp[SADB_EXT_SENSITIVITY];
m_sa_replay = (struct sadb_x_sa_replay *)mhp[SADB_X_EXT_SA_REPLAY];
+ natt_type = (struct sadb_x_nat_t_type *)mhp[SADB_X_EXT_NAT_T_TYPE];
+ natt_sport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_SPORT];
+ natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT];
+ natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI];
+ natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR];
+
/* source address */
if (m_saddr == NULL) {
printf("no ADDRESS_SRC extension.\n");
return;
}
- printf("%s ", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
+ printf("%s", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
+ if (natt_type != NULL && natt_sport != NULL)
+ printf("[%u]", ntohs(natt_sport->sadb_x_nat_t_port_port));
/* destination address */
if (m_daddr == NULL) {
- printf("no ADDRESS_DST extension.\n");
+ printf("\nno ADDRESS_DST extension.\n");
return;
}
- printf("%s ", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
+ printf(" %s", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
+ if (natt_type != NULL && natt_dport != NULL)
+ printf("[%u]", ntohs(natt_dport->sadb_x_nat_t_port_port));
/* SA type */
if (m_sa == NULL) {
- printf("no SA extension.\n");
+ printf("\nno SA extension.\n");
return;
}
if (m_sa2 == NULL) {
- printf("no SA2 extension.\n");
+ printf("\nno SA2 extension.\n");
return;
}
printf("\n\t");
- GETMSGSTR(str_satype, m->sadb_msg_satype);
+ if (m->sadb_msg_satype == SADB_SATYPE_ESP && natt_type != NULL)
+ printf("esp-udp ");
+ else
+ GETMSGSTR(str_satype, m->sadb_msg_satype);
printf("mode=");
GETMSGSTR(str_mode, m_sa2->sadb_x_sa2_mode);
@@ -282,6 +298,18 @@ pfkey_sadump(m)
(u_int32_t)m_sa2->sadb_x_sa2_reqid,
(u_int32_t)m_sa2->sadb_x_sa2_reqid);
+ /* other NAT-T information */
+ if (natt_type != NULL && (natt_oai != NULL || natt_oar != NULL)) {
+ printf("\tNAT:");
+ if (natt_oai != NULL)
+ printf(" OAI=%s",
+ str_ipaddr((struct sockaddr *)(natt_oai + 1)));
+ if (natt_oar != NULL)
+ printf(" OAR=%s",
+ str_ipaddr((struct sockaddr *)(natt_oar + 1)));
+ printf("\n");
+ }
+
/* encryption key */
if (m->sadb_msg_satype == SADB_X_SATYPE_IPCOMP) {
printf("\tC: ");
diff --git a/lib/libnetbsd/glob.h b/lib/libnetbsd/glob.h
new file mode 100644
index 000000000000..a42d82313ec5
--- /dev/null
+++ b/lib/libnetbsd/glob.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBNETBSD_GLOB_H_
+#define _LIBNETBSD_GLOB_H_
+
+#include_next <glob.h>
+
+#ifndef __gl_stat_t
+#define __gl_stat_t struct stat
+#endif
+
+#endif
diff --git a/lib/libnetbsd/pthread.h b/lib/libnetbsd/pthread.h
new file mode 100644
index 000000000000..f4365746b980
--- /dev/null
+++ b/lib/libnetbsd/pthread.h
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBNETBSD_PTHREAD_H_
+#define _LIBNETBSD_PTHREAD_H_
+
+#include_next <pthread.h>
+#include <pthread_np.h>
+
+#endif
diff --git a/lib/libnetbsd/sha1.h b/lib/libnetbsd/sha1.h
index 41280c58b076..9da870eacf6e 100644
--- a/lib/libnetbsd/sha1.h
+++ b/lib/libnetbsd/sha1.h
@@ -35,8 +35,11 @@
#include <sha.h>
+#define SHA1_CTX SHA_CTX
+
#define SHA1End SHA1_End
#define SHA1File SHA1_File
+#define SHA1Final SHA1_Final
#define SHA1Init SHA1_Init
#define SHA1Update SHA1_Update
diff --git a/lib/libnetbsd/sha2.h b/lib/libnetbsd/sha2.h
index b67691d54fb0..6329284924fc 100644
--- a/lib/libnetbsd/sha2.h
+++ b/lib/libnetbsd/sha2.h
@@ -34,6 +34,7 @@
#define _SHA2_H_
#include <sha256.h>
+#include <sha384.h>
#include <sha512.h>
#endif /* _SHA2_H_ */
diff --git a/lib/libnetbsd/sys/event.h b/lib/libnetbsd/sys/event.h
new file mode 100644
index 000000000000..88a363c8bfc5
--- /dev/null
+++ b/lib/libnetbsd/sys/event.h
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_EVENT_H_
+#define _LIBNETBSD_SYS_EVENT_H_
+
+/*
+ * kqueue on FreeBSD requires sys/event.h, which in turn uses uintptr_t
+ * (defined in sys/types.h), so in order to accomodate their requirements,
+ * pull in sys/types.h as part of event.h.
+ */
+#include <sys/types.h>
+
+#include_next <sys/event.h>
+
+#endif
diff --git a/lib/libnetbsd/sys/types.h b/lib/libnetbsd/sys/types.h
new file mode 100644
index 000000000000..e14dd498fe4b
--- /dev/null
+++ b/lib/libnetbsd/sys/types.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_TYPES_H_
+#define _LIBNETBSD_SYS_TYPES_H_
+
+#include_next <sys/types.h>
+
+#include <sys/param.h> /* For NBBY */
+
+#endif
diff --git a/lib/libnetbsd/sys/wait.h b/lib/libnetbsd/sys/wait.h
new file mode 100644
index 000000000000..a9369808d8e5
--- /dev/null
+++ b/lib/libnetbsd/sys/wait.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2017 Dell, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$ *
+ */
+
+#ifndef _LIBNETBSD_SYS_WAIT_H_
+#define _LIBNETBSD_SYS_WAIT_H_
+
+#include_next <sys/wait.h>
+
+#define wrusage __wrusage
+
+#endif
diff --git a/lib/libnetbsd/util.h b/lib/libnetbsd/util.h
index c7d32e132336..99bc3cabcf11 100644
--- a/lib/libnetbsd/util.h
+++ b/lib/libnetbsd/util.h
@@ -30,12 +30,13 @@
* SUCH DAMAGE.
*/
-#ifndef _UTIL_H_
-#define _UTIL_H_
+#ifndef _LIBNETBSD_UTIL_H_
+#define _LIBNETBSD_UTIL_H_
+#include <sys/types.h>
#include <libutil.h>
char *flags_to_string(u_long flags, const char *def);
int string_to_flags(char **stringp, u_long *setp, u_long *clrp);
-#endif /* _UTIL_H_ */
+#endif
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index 112a75b39414..537fca759954 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -168,6 +168,7 @@ struct devdesc
#define DEVT_NET 2
#define DEVT_CD 3
#define DEVT_ZFS 4
+#define DEVT_FD 5
int d_unit;
void *d_opendata;
};
diff --git a/lib/libstand/ufs.c b/lib/libstand/ufs.c
index 8d1a2958745b..329976a2b7fa 100644
--- a/lib/libstand/ufs.c
+++ b/lib/libstand/ufs.c
@@ -586,7 +586,7 @@ ufs_open(upath, f)
ncp = cp;
while ((c = *cp) != '\0' && c != '/') {
- if (++len > MAXNAMLEN) {
+ if (++len > UFS_MAXNAMLEN) {
rc = ENOENT;
goto out;
}
diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile
index aa0f25e51eab..abdf169a06fc 100644
--- a/lib/libutil/Makefile
+++ b/lib/libutil/Makefile
@@ -35,7 +35,8 @@ MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \
property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \
_secure_path.3 trimdomain.3 uucplock.3 pw_util.3
MAN+= login.conf.5
-MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3
+MLINKS+=hexdump.3 sbuf_hexdump.9
+MLINKS+=kld.3 kld_isloaded.3 kld.3 kld_load.3
MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3
MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \
login_cap.3 login_getcaplist.3 login_cap.3 login_getcapnum.3 \
@@ -57,9 +58,9 @@ MLINKS+=pidfile.3 pidfile_close.3 \
pidfile.3 pidfile_open.3 \
pidfile.3 pidfile_remove.3 \
pidfile.3 pidfile_write.3
-MLINKS+= property.3 property_find.3 property.3 properties_free.3
-MLINKS+= property.3 properties_read.3
-MLINKS+= pty.3 forkpty.3 pty.3 openpty.3
+MLINKS+=property.3 property_find.3 property.3 properties_free.3
+MLINKS+=property.3 properties_read.3
+MLINKS+=pty.3 forkpty.3 pty.3 openpty.3
MLINKS+=quotafile.3 quota_close.3 \
quotafile.3 quota_fsname.3 \
quotafile.3 quota_open.3 \
@@ -69,7 +70,7 @@ MLINKS+=quotafile.3 quota_close.3 \
quotafile.3 quota_write_limits.3 \
quotafile.3 quota_write_usage.3
MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \
- uucplock.3 uu_lockerr.3 uucplock.3 uu_unlock.3
+ uucplock.3 uu_lockerr.3 uucplock.3 uu_unlock.3
MLINKS+=pw_util.3 pw_copy.3 \
pw_util.3 pw_dup.3 \
pw_util.3 pw_edit.3 \
diff --git a/lib/libutil/hexdump.3 b/lib/libutil/hexdump.3
index 9fa96f899f95..ef3d65d7d9dd 100644
--- a/lib/libutil/hexdump.3
+++ b/lib/libutil/hexdump.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 8, 2014
+.Dd February 8, 2017
.Dt HEXDUMP 3
.Os
.Sh NAME
@@ -36,9 +36,10 @@
.Nd "dump a block of bytes to standard out in hexadecimal form"
.Sh SYNOPSIS
.In libutil.h
-.In sys/sbuf.h
.Ft void
.Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags"
+.In sys/types.h
+.In sys/sbuf.h
.Ft void
.Fo sbuf_hexdump
.Fa "struct sbuf *sb"