summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-10-01 09:36:43 +0000
committerbapt <bapt@FreeBSD.org>2015-10-01 09:36:43 +0000
commitf57d9054651c33b822be7c35cebf630912ba0aae (patch)
treea5914e0a02f1f78fbcece53ec11bfddc64f76781 /lib
parent934c5c6da6753f906bc4a905e249449fd15b850d (diff)
parent4636024b4abd268cb5e384fc0702be9f013f6fdb (diff)
downloadFreeBSD-src-f57d9054651c33b822be7c35cebf630912ba0aae.zip
FreeBSD-src-f57d9054651c33b822be7c35cebf630912ba0aae.tar.gz
Merge from head
Diffstat (limited to 'lib')
-rw-r--r--lib/clang/include/Makefile2
-rw-r--r--lib/clang/libllvmdebuginfo/Makefile.depend2
-rw-r--r--lib/clang/libllvminterpreter/Makefile.depend2
-rw-r--r--lib/csu/Makefile.inc5
-rw-r--r--lib/csu/aarch64/Makefile12
-rw-r--r--lib/csu/amd64/Makefile12
-rw-r--r--lib/csu/arm/Makefile12
-rw-r--r--lib/csu/arm/Makefile.depend4
-rw-r--r--lib/csu/arm/crti.S1
-rw-r--r--lib/csu/arm/crtn.S2
-rw-r--r--lib/csu/i386/Makefile12
-rw-r--r--lib/csu/i386/Makefile.depend2
-rw-r--r--lib/csu/mips/Makefile12
-rw-r--r--lib/csu/mips/Makefile.depend4
-rw-r--r--lib/csu/powerpc/Makefile12
-rw-r--r--lib/csu/powerpc/Makefile.depend4
-rw-r--r--lib/csu/powerpc64/Makefile12
-rw-r--r--lib/csu/powerpc64/Makefile.depend4
-rw-r--r--lib/csu/sparc64/Makefile12
-rw-r--r--lib/csu/sparc64/Makefile.depend4
-rw-r--r--lib/libblocksruntime/Makefile.depend2
-rw-r--r--lib/libc/Makefile.depend3
-rw-r--r--lib/libc/aarch64/gen/_set_tp.c1
-rw-r--r--lib/libc/amd64/gen/_set_tp.c1
-rw-r--r--lib/libc/arm/aeabi/aeabi_asm_double.S2
-rw-r--r--lib/libc/arm/aeabi/aeabi_asm_float.S2
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_double.S1
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_float.S1
-rw-r--r--lib/libc/arm/gen/__aeabi_read_tp.S1
-rw-r--r--lib/libc/arm/gen/_ctx_start.S2
-rw-r--r--lib/libc/arm/gen/_set_tp.c1
-rw-r--r--lib/libc/arm/gen/_setjmp.S2
-rw-r--r--lib/libc/arm/gen/alloca.S2
-rw-r--r--lib/libc/arm/gen/divsi3.S2
-rw-r--r--lib/libc/arm/gen/setjmp.S2
-rw-r--r--lib/libc/arm/gen/sigsetjmp.S2
-rw-r--r--lib/libc/arm/string/ffs.S2
-rw-r--r--lib/libc/arm/string/memcmp.S2
-rw-r--r--lib/libc/arm/string/memcpy_arm.S2
-rw-r--r--lib/libc/arm/string/memcpy_xscale.S2
-rw-r--r--lib/libc/arm/string/memmove.S2
-rw-r--r--lib/libc/arm/string/memset.S2
-rw-r--r--lib/libc/arm/string/strcmp.S2
-rw-r--r--lib/libc/arm/string/strlen.S2
-rw-r--r--lib/libc/arm/string/strncmp.S2
-rw-r--r--lib/libc/arm/sys/Ovfork.S2
-rw-r--r--lib/libc/arm/sys/brk.S2
-rw-r--r--lib/libc/arm/sys/cerror.S2
-rw-r--r--lib/libc/arm/sys/pipe.S2
-rw-r--r--lib/libc/arm/sys/ptrace.S2
-rw-r--r--lib/libc/arm/sys/sbrk.S2
-rw-r--r--lib/libc/arm/sys/shmat.S2
-rw-r--r--lib/libc/arm/sys/sigreturn.S2
-rw-r--r--lib/libc/arm/sys/syscall.S2
-rw-r--r--lib/libc/compat-43/creat.c2
-rw-r--r--lib/libc/compat-43/sigcompat.c10
-rw-r--r--lib/libc/db/hash/ndbm.c35
-rw-r--r--lib/libc/db/recno/rec_open.c2
-rw-r--r--lib/libc/gdtoa/_ldtoa.c1
-rw-r--r--lib/libc/gen/alarm.c3
-rw-r--r--lib/libc/gen/assert.c5
-rw-r--r--lib/libc/gen/clock.c2
-rw-r--r--lib/libc/gen/dlfcn.c4
-rw-r--r--lib/libc/gen/dup3.c2
-rw-r--r--lib/libc/gen/elf_utils.c3
-rw-r--r--lib/libc/gen/err.c5
-rw-r--r--lib/libc/gen/exec.c4
-rw-r--r--lib/libc/gen/feature_present.c1
-rw-r--r--lib/libc/gen/fmtcheck.c1
-rw-r--r--lib/libc/gen/fnmatch.c95
-rw-r--r--lib/libc/gen/ftok.c4
-rw-r--r--lib/libc/gen/fts-compat.c67
-rw-r--r--lib/libc/gen/fts.c9
-rw-r--r--lib/libc/gen/getbsize.c4
-rw-r--r--lib/libc/gen/getcwd.c4
-rw-r--r--lib/libc/gen/getdomainname.c4
-rw-r--r--lib/libc/gen/getgrent.c5
-rw-r--r--lib/libc/gen/gethostname.c4
-rw-r--r--lib/libc/gen/getloadavg.c4
-rw-r--r--lib/libc/gen/getmntinfo.c4
-rw-r--r--lib/libc/gen/getpagesize.c2
-rw-r--r--lib/libc/gen/getpwent.c5
-rw-r--r--lib/libc/gen/getusershell.c17
-rw-r--r--lib/libc/gen/getvfsbyname.c4
-rw-r--r--lib/libc/gen/glob.c16
-rw-r--r--lib/libc/gen/initgroups.c4
-rw-r--r--lib/libc/gen/isatty.c3
-rw-r--r--lib/libc/gen/nlist.c26
-rw-r--r--lib/libc/gen/pause.c2
-rw-r--r--lib/libc/gen/popen.c6
-rw-r--r--lib/libc/gen/psignal.c4
-rw-r--r--lib/libc/gen/raise.c1
-rw-r--r--lib/libc/gen/readdir.c12
-rw-r--r--lib/libc/gen/rewinddir.c3
-rw-r--r--lib/libc/gen/seekdir.c4
-rw-r--r--lib/libc/gen/semctl.c1
-rw-r--r--lib/libc/gen/setjmperr.c2
-rw-r--r--lib/libc/gen/sigsetops.c18
-rw-r--r--lib/libc/gen/sleep.c2
-rw-r--r--lib/libc/gen/strtofflags.c9
-rw-r--r--lib/libc/gen/sysconf.c3
-rw-r--r--lib/libc/gen/telldir.c10
-rw-r--r--lib/libc/gen/tls.c2
-rw-r--r--lib/libc/gen/ttyslot.c2
-rw-r--r--lib/libc/gen/ualarm.c4
-rw-r--r--lib/libc/gen/uname.c2
-rw-r--r--lib/libc/gen/unvis-compat.c2
-rw-r--r--lib/libc/gen/usleep.c2
-rw-r--r--lib/libc/gen/utime.c4
-rw-r--r--lib/libc/gen/wait.c2
-rw-r--r--lib/libc/gen/wait3.c2
-rw-r--r--lib/libc/gen/waitid.c2
-rw-r--r--lib/libc/gen/waitpid.c2
-rw-r--r--lib/libc/gen/wordexp.330
-rw-r--r--lib/libc/gen/wordexp.c212
-rw-r--r--lib/libc/gmon/gmon.c10
-rw-r--r--lib/libc/inet/inet_lnaof.c3
-rw-r--r--lib/libc/inet/inet_makeaddr.c3
-rw-r--r--lib/libc/inet/inet_net_ntop.c13
-rw-r--r--lib/libc/inet/inet_neta.c5
-rw-r--r--lib/libc/inet/inet_netof.c3
-rw-r--r--lib/libc/inet/inet_network.c3
-rw-r--r--lib/libc/isc/ev_timers.c4
-rw-r--r--lib/libc/locale/isctype.c69
-rw-r--r--lib/libc/locale/iswctype.c63
-rw-r--r--lib/libc/locale/setlocale.c12
-rw-r--r--lib/libc/locale/tolower.c7
-rw-r--r--lib/libc/locale/toupper.c7
-rw-r--r--lib/libc/mips/gen/_set_tp.c1
-rw-r--r--lib/libc/net/getaddrinfo.320
-rw-r--r--lib/libc/net/getaddrinfo.c92
-rw-r--r--lib/libc/net/gethostbydns.c7
-rw-r--r--lib/libc/net/gethostnamadr.c7
-rw-r--r--lib/libc/net/getnameinfo.323
-rw-r--r--lib/libc/net/getnameinfo.c148
-rw-r--r--lib/libc/net/getnetbydns.c2
-rw-r--r--lib/libc/net/getnetnamadr.c7
-rw-r--r--lib/libc/net/getproto.c6
-rw-r--r--lib/libc/net/getservent.c4
-rw-r--r--lib/libc/net/linkaddr.c7
-rw-r--r--lib/libc/net/map_v4v6.c1
-rw-r--r--lib/libc/net/netdb_private.h19
-rw-r--r--lib/libc/net/nscache.c1
-rw-r--r--lib/libc/net/nslexer.l5
-rw-r--r--lib/libc/net/nsparser.y3
-rw-r--r--lib/libc/net/nss_compat.c10
-rw-r--r--lib/libc/net/ntoh.c2
-rw-r--r--lib/libc/net/rcmd.c61
-rw-r--r--lib/libc/net/recv.c5
-rw-r--r--lib/libc/net/rthdr.c31
-rw-r--r--lib/libc/net/send.c5
-rw-r--r--lib/libc/net/sockatmark.c5
-rw-r--r--lib/libc/posix1e/acl_compat.c4
-rw-r--r--lib/libc/posix1e/acl_support.h2
-rw-r--r--lib/libc/powerpc/gen/_set_tp.c1
-rw-r--r--lib/libc/powerpc64/gen/_set_tp.c1
-rw-r--r--lib/libc/resolv/h_errno.c3
-rw-r--r--lib/libc/resolv/res_debug.c18
-rw-r--r--lib/libc/resolv/res_init.c3
-rw-r--r--lib/libc/resolv/res_mkupdate.c2
-rw-r--r--lib/libc/resolv/res_send.c7
-rw-r--r--lib/libc/rpc/auth_unix.c28
-rw-r--r--lib/libc/rpc/authdes_prot.c8
-rw-r--r--lib/libc/rpc/authunix_prot.c4
-rw-r--r--lib/libc/rpc/bindresvport.c8
-rw-r--r--lib/libc/rpc/clnt_bcast.c61
-rw-r--r--lib/libc/rpc/clnt_perror.c25
-rw-r--r--lib/libc/rpc/clnt_raw.c36
-rw-r--r--lib/libc/rpc/clnt_simple.c20
-rw-r--r--lib/libc/rpc/clnt_vc.c71
-rw-r--r--lib/libc/rpc/des_crypt.c2
-rw-r--r--lib/libc/rpc/getnetconfig.c31
-rw-r--r--lib/libc/rpc/getnetpath.c16
-rw-r--r--lib/libc/rpc/getrpcent.c4
-rw-r--r--lib/libc/rpc/getrpcport.c4
-rw-r--r--lib/libc/rpc/mt_misc.c2
-rw-r--r--lib/libc/rpc/netname.c13
-rw-r--r--lib/libc/rpc/netnamer.c20
-rw-r--r--lib/libc/rpc/pmap_getmaps.c3
-rw-r--r--lib/libc/rpc/pmap_getport.c7
-rw-r--r--lib/libc/rpc/pmap_prot.c4
-rw-r--r--lib/libc/rpc/pmap_prot2.c8
-rw-r--r--lib/libc/rpc/pmap_rmt.c19
-rw-r--r--lib/libc/rpc/rpc_callmsg.c4
-rw-r--r--lib/libc/rpc/rpc_generic.c35
-rw-r--r--lib/libc/rpc/rpc_prot.c8
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/rpc/rpcb_clnt.c33
-rw-r--r--lib/libc/rpc/rpcb_prot.c32
-rw-r--r--lib/libc/rpc/rpcb_st_xdr.c28
-rw-r--r--lib/libc/rpc/svc.c100
-rw-r--r--lib/libc/rpc/svc_auth.c4
-rw-r--r--lib/libc/rpc/svc_auth_unix.c8
-rw-r--r--lib/libc/rpc/svc_generic.c36
-rw-r--r--lib/libc/rpc/svc_raw.c34
-rw-r--r--lib/libc/rpc/svc_run.c4
-rw-r--r--lib/libc/rpc/svc_simple.c22
-rw-r--r--lib/libc/sparc64/gen/_set_tp.c1
-rw-r--r--lib/libc/stdio/_flock_stub.c3
-rw-r--r--lib/libc/stdio/fgetwln.c2
-rw-r--r--lib/libc/stdio/findfp.c7
-rw-r--r--lib/libc/stdio/getchar.c2
-rw-r--r--lib/libc/stdio/vfscanf.c4
-rw-r--r--lib/libc/stdlib/abort.c2
-rw-r--r--lib/libc/stdlib/abs.c3
-rw-r--r--lib/libc/stdlib/atexit.c3
-rw-r--r--lib/libc/stdlib/atof.c7
-rw-r--r--lib/libc/stdlib/atoi.c7
-rw-r--r--lib/libc/stdlib/atol.c7
-rw-r--r--lib/libc/stdlib/atoll.c7
-rw-r--r--lib/libc/stdlib/bsearch.c16
-rw-r--r--lib/libc/stdlib/exit.c3
-rw-r--r--lib/libc/stdlib/heapsort.c17
-rw-r--r--lib/libc/stdlib/labs.c3
-rw-r--r--lib/libc/stdlib/merge.c24
-rw-r--r--lib/libc/stdlib/qsort.c4
-rw-r--r--lib/libc/stdlib/radixsort.c30
-rw-r--r--lib/libc/stdlib/rand.c7
-rw-r--r--lib/libc/stdlib/tfind.c13
-rw-r--r--lib/libc/stdtime/strftime.c32
-rw-r--r--lib/libc/string/strchrnul.c2
-rw-r--r--lib/libc/sys/Makefile.inc4
-rw-r--r--lib/libc/sys/__error.c2
-rw-r--r--lib/libc/sys/close.c1
-rw-r--r--lib/libc/sys/fsync.c1
-rw-r--r--lib/libc/sys/msync.c1
-rw-r--r--lib/libc/sys/readv.c1
-rw-r--r--lib/libc/sys/reboot.214
-rw-r--r--lib/libc/sys/setuid.29
-rw-r--r--lib/libc/sys/writev.c1
-rw-r--r--lib/libc/tests/gen/posix_spawn/Makefile2
-rw-r--r--lib/libc/tests/stdio/fmemopen2_test.c1
-rw-r--r--lib/libc/xdr/xdr_float.c4
-rw-r--r--lib/libcompiler_rt/Makefile2
-rw-r--r--lib/libcrypt/tests/Makefile.depend2
-rw-r--r--lib/libcuse/Makefile.depend2
-rw-r--r--lib/libcxxrt/Makefile.depend.host2
-rw-r--r--lib/libevent/Makefile.depend2
-rw-r--r--lib/libfetch/common.c3
-rw-r--r--lib/libgpib/Makefile.depend2
-rw-r--r--lib/libiconv_modules/BIG5/Makefile.depend2
-rw-r--r--lib/libiconv_modules/DECHanyu/Makefile.depend2
-rw-r--r--lib/libiconv_modules/EUC/Makefile.depend2
-rw-r--r--lib/libiconv_modules/EUCTW/Makefile.depend2
-rw-r--r--lib/libiconv_modules/GBK2K/Makefile.depend2
-rw-r--r--lib/libiconv_modules/HZ/Makefile.depend2
-rw-r--r--lib/libiconv_modules/ISO2022/Makefile.depend2
-rw-r--r--lib/libiconv_modules/JOHAB/Makefile.depend2
-rw-r--r--lib/libiconv_modules/MSKanji/Makefile.depend2
-rw-r--r--lib/libiconv_modules/UES/Makefile.depend2
-rw-r--r--lib/libiconv_modules/UTF1632/Makefile.depend2
-rw-r--r--lib/libiconv_modules/UTF7/Makefile.depend2
-rw-r--r--lib/libiconv_modules/UTF8/Makefile.depend2
-rw-r--r--lib/libiconv_modules/VIQR/Makefile.depend2
-rw-r--r--lib/libiconv_modules/ZW/Makefile.depend2
-rw-r--r--lib/libiconv_modules/iconv_none/Makefile.depend2
-rw-r--r--lib/libiconv_modules/iconv_std/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_646/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_none/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_parallel/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_serial/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_std/Makefile.depend2
-rw-r--r--lib/libiconv_modules/mapper_zone/Makefile.depend2
-rw-r--r--lib/liblzma/Makefile12
-rw-r--r--lib/libmagic/config.h6
-rw-r--r--lib/libmilter/Makefile.depend2
-rw-r--r--lib/libpam/Makefile.inc1
-rw-r--r--lib/libpam/libpam/Makefile1
-rw-r--r--lib/librpcsec_gss/Makefile.depend2
-rw-r--r--lib/libsm/Makefile.depend2
-rw-r--r--lib/libsmb/Makefile.depend2
-rw-r--r--lib/libstand/Makefile.depend2
-rw-r--r--lib/libstdbuf/Makefile.depend2
-rw-r--r--lib/libstdthreads/Makefile.depend2
-rw-r--r--lib/libugidfw/ugidfw.c2
-rw-r--r--lib/libunbound/Makefile2
-rw-r--r--lib/libunbound/Makefile.depend2
-rw-r--r--lib/libusb/Makefile13
-rw-r--r--lib/libvgl/Makefile.depend2
-rw-r--r--lib/libxo/Makefile.depend1
-rw-r--r--lib/libz/Makefile5
-rw-r--r--lib/ncurses/form/Makefile.depend2
-rw-r--r--lib/ncurses/formw/Makefile.depend2
-rw-r--r--lib/ncurses/menu/Makefile.depend2
-rw-r--r--lib/ncurses/menuw/Makefile.depend2
-rw-r--r--lib/ncurses/ncurses/Makefile1
286 files changed, 1206 insertions, 1532 deletions
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile
index d78b20d..6f679bb 100644
--- a/lib/clang/include/Makefile
+++ b/lib/clang/include/Makefile
@@ -54,7 +54,7 @@ INCS= __stddef_max_align_t.h \
xopintrin.h \
${GENINCS}
GENINCS= arm_neon.h
-CLEANFILES= ${GENINCS}
+CLEANFILES= ${GENINCS} ${GENINCS:C/\.h$/.d/}
# avoid a circular dependency
GENDIRDEPS_FILTER+= Nusr.bin/clang/clang-tblgen.host
diff --git a/lib/clang/libllvmdebuginfo/Makefile.depend b/lib/clang/libllvmdebuginfo/Makefile.depend
index c9899bc..3e7f3f5 100644
--- a/lib/clang/libllvmdebuginfo/Makefile.depend
+++ b/lib/clang/libllvmdebuginfo/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
include/xlocale \
diff --git a/lib/clang/libllvminterpreter/Makefile.depend b/lib/clang/libllvminterpreter/Makefile.depend
index 4fc7d45..ff32938 100644
--- a/lib/clang/libllvminterpreter/Makefile.depend
+++ b/lib/clang/libllvminterpreter/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
include/xlocale \
diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc
index ff77f66..95d5c5e 100644
--- a/lib/csu/Makefile.inc
+++ b/lib/csu/Makefile.inc
@@ -7,8 +7,3 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/'
NO_WMISSING_VARIABLE_DECLARATIONS=
.include "../Makefile.inc"
-
-.if ${MK_STAGING} == "yes" && ${.TARGETS:Nall} == ""
-FILES?= ${OBJS}
-FILESDIR?= ${LIBDIR}
-.endif
diff --git a/lib/csu/aarch64/Makefile b/lib/csu/aarch64/Makefile
index bf4c7b1..9747619 100644
--- a/lib/csu/aarch64/Makefile
+++ b/lib/csu/aarch64/Makefile
@@ -8,7 +8,13 @@ OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -37,8 +43,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index 80d14a7..e9ca6b9 100644
--- a/lib/csu/amd64/Makefile
+++ b/lib/csu/amd64/Makefile
@@ -9,7 +9,13 @@ CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
CFLAGS+= -fno-omit-frame-pointer
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -38,8 +44,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/arm/Makefile b/lib/csu/arm/Makefile
index bf4c7b1..9747619 100644
--- a/lib/csu/arm/Makefile
+++ b/lib/csu/arm/Makefile
@@ -8,7 +8,13 @@ OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -37,8 +43,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/arm/Makefile.depend b/lib/csu/arm/Makefile.depend
index e8d7c61..79506ce 100644
--- a/lib/csu/arm/Makefile.depend
+++ b/lib/csu/arm/Makefile.depend
@@ -1,10 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
diff --git a/lib/csu/arm/crti.S b/lib/csu/arm/crti.S
index 40e83bb..c6c37eb 100644
--- a/lib/csu/arm/crti.S
+++ b/lib/csu/arm/crti.S
@@ -19,3 +19,4 @@ _fini:
stmdb sp!, {fp, ip, lr, pc}
sub fp, ip, #4
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/csu/arm/crtn.S b/lib/csu/arm/crtn.S
index 962f0ed..25bbd57 100644
--- a/lib/csu/arm/crtn.S
+++ b/lib/csu/arm/crtn.S
@@ -8,3 +8,5 @@ __FBSDID("$FreeBSD$");
.section .fini,"ax",%progbits
ldmea fp, {fp, sp, pc}
mov pc, lr
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index d5ca479..d64f803 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -8,7 +8,13 @@ OBJS+= gcrt1.o crt1.o Scrt1.o
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s
@@ -48,8 +54,4 @@ Scrt1.o: Scrt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
${OBJCOPY} --localize-symbol _start1 Scrt1.o
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/i386/Makefile.depend b/lib/csu/i386/Makefile.depend
index 76d719e..79506ce 100644
--- a/lib/csu/i386/Makefile.depend
+++ b/lib/csu/i386/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
diff --git a/lib/csu/mips/Makefile b/lib/csu/mips/Makefile
index bf4c7b1..9747619 100644
--- a/lib/csu/mips/Makefile
+++ b/lib/csu/mips/Makefile
@@ -8,7 +8,13 @@ OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -37,8 +43,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/mips/Makefile.depend b/lib/csu/mips/Makefile.depend
index e8d7c61..79506ce 100644
--- a/lib/csu/mips/Makefile.depend
+++ b/lib/csu/mips/Makefile.depend
@@ -1,10 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile
index bf4c7b1..9747619 100644
--- a/lib/csu/powerpc/Makefile
+++ b/lib/csu/powerpc/Makefile
@@ -8,7 +8,13 @@ OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -37,8 +43,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/powerpc/Makefile.depend b/lib/csu/powerpc/Makefile.depend
index e8d7c61..79506ce 100644
--- a/lib/csu/powerpc/Makefile.depend
+++ b/lib/csu/powerpc/Makefile.depend
@@ -1,10 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 1c93355..09b643e 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -16,7 +16,13 @@ CFLAGS+= -I${.CURDIR}/../common \
CC:= gcc
COMPILER_TYPE:= gcc
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
CLEANFILES+= crt1.s gcrt1.s Scrt1.s
@@ -45,8 +51,4 @@ Scrt1.s: crt1.c
Scrt1.o: Scrt1.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/powerpc64/Makefile.depend b/lib/csu/powerpc64/Makefile.depend
index e8d7c61..79506ce 100644
--- a/lib/csu/powerpc64/Makefile.depend
+++ b/lib/csu/powerpc64/Makefile.depend
@@ -1,10 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
diff --git a/lib/csu/sparc64/Makefile b/lib/csu/sparc64/Makefile
index 7f8dd7a..0074cb9 100644
--- a/lib/csu/sparc64/Makefile
+++ b/lib/csu/sparc64/Makefile
@@ -7,7 +7,13 @@ OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../../libc/include
-all: ${OBJS}
+FILES= ${OBJS}
+FILESMODE= ${LIBMODE}
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESDIR= ${LIBDIR}
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CLEANFILES= ${OBJS}
@@ -17,8 +23,4 @@ gcrt1.o: crt1.c
Scrt1.o: crt1.c
${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC}
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${OBJS} ${DESTDIR}${LIBDIR}
-
.include <bsd.lib.mk>
diff --git a/lib/csu/sparc64/Makefile.depend b/lib/csu/sparc64/Makefile.depend
index e8d7c61..79506ce 100644
--- a/lib/csu/sparc64/Makefile.depend
+++ b/lib/csu/sparc64/Makefile.depend
@@ -1,10 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
diff --git a/lib/libblocksruntime/Makefile.depend b/lib/libblocksruntime/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libblocksruntime/Makefile.depend
+++ b/lib/libblocksruntime/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libc/Makefile.depend b/lib/libc/Makefile.depend
index 05b44c8..02168e8 100644
--- a/lib/libc/Makefile.depend
+++ b/lib/libc/Makefile.depend
@@ -126,6 +126,9 @@ jemalloc_mb.po: jemalloc_mb.c
jemalloc_mutex.So: jemalloc_mutex.c
jemalloc_mutex.o: jemalloc_mutex.c
jemalloc_mutex.po: jemalloc_mutex.c
+jemalloc_pages.So: jemalloc_pages.c
+jemalloc_pages.o: jemalloc_pages.c
+jemalloc_pages.po: jemalloc_pages.c
jemalloc_prof.So: jemalloc_prof.c
jemalloc_prof.o: jemalloc_prof.c
jemalloc_prof.po: jemalloc_prof.c
diff --git a/lib/libc/aarch64/gen/_set_tp.c b/lib/libc/aarch64/gen/_set_tp.c
index a587b2e..871acb3 100644
--- a/lib/libc/aarch64/gen/_set_tp.c
+++ b/lib/libc/aarch64/gen/_set_tp.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <machine/sysarch.h>
#include <stdlib.h>
+#include "libc_private.h"
void
_set_tp(void *tp)
diff --git a/lib/libc/amd64/gen/_set_tp.c b/lib/libc/amd64/gen/_set_tp.c
index 02e5e14..d5526fa 100644
--- a/lib/libc/amd64/gen/_set_tp.c
+++ b/lib/libc/amd64/gen/_set_tp.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <stdint.h>
#include <machine/sysarch.h>
+#include "libc_private.h"
void
_set_tp(void *tp)
diff --git a/lib/libc/arm/aeabi/aeabi_asm_double.S b/lib/libc/arm/aeabi/aeabi_asm_double.S
index 7a5af82..ced4d78 100644
--- a/lib/libc/arm/aeabi/aeabi_asm_double.S
+++ b/lib/libc/arm/aeabi/aeabi_asm_double.S
@@ -117,3 +117,5 @@ ENTRY(__aeabi_cdcmpeq)
msr cpsr_c, ip
RET
END(__aeabi_cdcmpeq)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/aeabi/aeabi_asm_float.S b/lib/libc/arm/aeabi/aeabi_asm_float.S
index e05daa5..de6b1c8 100644
--- a/lib/libc/arm/aeabi/aeabi_asm_float.S
+++ b/lib/libc/arm/aeabi/aeabi_asm_float.S
@@ -108,3 +108,5 @@ ENTRY(__aeabi_cfcmpeq)
msr cpsr_c, ip
RET
END(__aeabi_cfcmpeq)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_double.S b/lib/libc/arm/aeabi/aeabi_vfp_double.S
index aae49f8..be4309d 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_double.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_double.S
@@ -201,3 +201,4 @@ AEABI_ENTRY(dsub)
RET
AEABI_END(dsub)
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_float.S b/lib/libc/arm/aeabi/aeabi_vfp_float.S
index 7de8daf..c9df41c 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_float.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_float.S
@@ -188,3 +188,4 @@ AEABI_ENTRY(fsub)
RET
AEABI_END(fsub)
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/__aeabi_read_tp.S b/lib/libc/arm/gen/__aeabi_read_tp.S
index 670d0b8..224d6a6 100644
--- a/lib/libc/arm/gen/__aeabi_read_tp.S
+++ b/lib/libc/arm/gen/__aeabi_read_tp.S
@@ -45,3 +45,4 @@ END(__aeabi_read_tp)
.word ARM_TP_ADDRESS
#endif
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/_ctx_start.S b/lib/libc/arm/gen/_ctx_start.S
index 41bfff9..faedfb5 100644
--- a/lib/libc/arm/gen/_ctx_start.S
+++ b/lib/libc/arm/gen/_ctx_start.S
@@ -8,3 +8,5 @@ ENTRY(_ctx_start)
bl _C_LABEL(ctx_done)
bl _C_LABEL(abort)
END(_ctx_start)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/_set_tp.c b/lib/libc/arm/gen/_set_tp.c
index 97cabec..2332f59 100644
--- a/lib/libc/arm/gen/_set_tp.c
+++ b/lib/libc/arm/gen/_set_tp.c
@@ -30,6 +30,7 @@
#include <sys/types.h>
#include <machine/sysarch.h>
+#include "libc_private.h"
void
_set_tp(void *tp)
diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S
index 853f61c..e3c67fa 100644
--- a/lib/libc/arm/gen/_setjmp.S
+++ b/lib/libc/arm/gen/_setjmp.S
@@ -157,3 +157,5 @@ botch:
b .
#endif
END(_longjmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/alloca.S b/lib/libc/arm/gen/alloca.S
index e4a73d4..2539b7a 100644
--- a/lib/libc/arm/gen/alloca.S
+++ b/lib/libc/arm/gen/alloca.S
@@ -44,3 +44,5 @@ ENTRY(alloca)
mov r0, sp /* r0 = base of new space */
RET
END(alloca)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/divsi3.S b/lib/libc/arm/gen/divsi3.S
index 82de5de..fac0663 100644
--- a/lib/libc/arm/gen/divsi3.S
+++ b/lib/libc/arm/gen/divsi3.S
@@ -389,3 +389,5 @@ ENTRY(__divsi3)
mov r0, r3
RET
END(__divsi3)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S
index c9ae329..4e3850d 100644
--- a/lib/libc/arm/gen/setjmp.S
+++ b/lib/libc/arm/gen/setjmp.S
@@ -158,3 +158,5 @@ ENTRY(__longjmp)
bl PIC_SYM(_C_LABEL(abort), PLT)
1: b 1b /* Cannot get here */
END(__longjmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/gen/sigsetjmp.S b/lib/libc/arm/gen/sigsetjmp.S
index 3743e89..236f531 100644
--- a/lib/libc/arm/gen/sigsetjmp.S
+++ b/lib/libc/arm/gen/sigsetjmp.S
@@ -66,3 +66,5 @@ ENTRY(siglongjmp)
beq PIC_SYM(_C_LABEL(_longjmp), PLT)
b PIC_SYM(_C_LABEL(longjmp), PLT)
END(siglongjmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S
index cc7f396..0ed8152 100644
--- a/lib/libc/arm/string/ffs.S
+++ b/lib/libc/arm/string/ffs.S
@@ -84,3 +84,5 @@ ENTRY(ffs)
RET
#endif
END(ffs)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memcmp.S b/lib/libc/arm/string/memcmp.S
index 6fd8130..33a11b7 100644
--- a/lib/libc/arm/string/memcmp.S
+++ b/lib/libc/arm/string/memcmp.S
@@ -181,3 +181,5 @@ ENTRY(memcmp)
RET
#endif
END(memcmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memcpy_arm.S b/lib/libc/arm/string/memcpy_arm.S
index 56fb703..57b0449 100644
--- a/lib/libc/arm/string/memcpy_arm.S
+++ b/lib/libc/arm/string/memcpy_arm.S
@@ -334,3 +334,5 @@ ENTRY(memcpy)
sub r1, r1, #1
b .Lmemcpy_l4
END(memcpy)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memcpy_xscale.S b/lib/libc/arm/string/memcpy_xscale.S
index a451de4..ab01544 100644
--- a/lib/libc/arm/string/memcpy_xscale.S
+++ b/lib/libc/arm/string/memcpy_xscale.S
@@ -1784,3 +1784,5 @@ ENTRY(memcpy)
bx lr
#endif /* !_STANDALONE */
END(memcpy)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S
index 2cd5a5e..8f96147 100644
--- a/lib/libc/arm/string/memmove.S
+++ b/lib/libc/arm/string/memmove.S
@@ -609,3 +609,5 @@ END(memmove)
#else
END(bcopy)
#endif
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S
index 6d76901..96d2f93 100644
--- a/lib/libc/arm/string/memset.S
+++ b/lib/libc/arm/string/memset.S
@@ -263,3 +263,5 @@ END(bzero)
#else
END(memset)
#endif
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/strcmp.S b/lib/libc/arm/string/strcmp.S
index d610fea..1cdce8b 100644
--- a/lib/libc/arm/string/strcmp.S
+++ b/lib/libc/arm/string/strcmp.S
@@ -43,3 +43,5 @@ ENTRY(strcmp)
sub r0, r2, r3
RET
END(strcmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S
index c9334f9..240fa7d 100644
--- a/lib/libc/arm/string/strlen.S
+++ b/lib/libc/arm/string/strlen.S
@@ -83,3 +83,5 @@ ENTRY(strlen)
mov r0, r1
RET
END(strlen)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/string/strncmp.S b/lib/libc/arm/string/strncmp.S
index a5c0320..affcaa0 100644
--- a/lib/libc/arm/string/strncmp.S
+++ b/lib/libc/arm/string/strncmp.S
@@ -56,3 +56,5 @@ ENTRY(strncmp)
sub r0, r2, r3
RET
END(strncmp)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/Ovfork.S b/lib/libc/arm/sys/Ovfork.S
index 4520e02..73c619e 100644
--- a/lib/libc/arm/sys/Ovfork.S
+++ b/lib/libc/arm/sys/Ovfork.S
@@ -53,3 +53,5 @@ ENTRY(vfork)
and r0, r0, r1 /* r0 == 0 if child, else unchanged */
mov r15, r2
END(vfork)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/brk.S b/lib/libc/arm/sys/brk.S
index e5f8336..bf1b4fb 100644
--- a/lib/libc/arm/sys/brk.S
+++ b/lib/libc/arm/sys/brk.S
@@ -91,3 +91,5 @@ ENTRY(_brk)
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
END(_brk)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/cerror.S b/lib/libc/arm/sys/cerror.S
index 26f5211..5fad698 100644
--- a/lib/libc/arm/sys/cerror.S
+++ b/lib/libc/arm/sys/cerror.S
@@ -47,3 +47,5 @@ ASENTRY(CERROR)
mvn r1, #0x00000000
ldmfd sp!, {r4, pc}
END(CERROR)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/pipe.S b/lib/libc/arm/sys/pipe.S
index 77ce0fc..778e923 100644
--- a/lib/libc/arm/sys/pipe.S
+++ b/lib/libc/arm/sys/pipe.S
@@ -49,3 +49,5 @@ ENTRY(_pipe)
mov r0, #0x00000000
RET
END(_pipe)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/ptrace.S b/lib/libc/arm/sys/ptrace.S
index 876da32..dade223 100644
--- a/lib/libc/arm/sys/ptrace.S
+++ b/lib/libc/arm/sys/ptrace.S
@@ -47,3 +47,5 @@ ENTRY(ptrace)
bcs PIC_SYM(CERROR, PLT)
RET
END(ptrace)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/sbrk.S b/lib/libc/arm/sys/sbrk.S
index 5cd9a03..25622c4 100644
--- a/lib/libc/arm/sys/sbrk.S
+++ b/lib/libc/arm/sys/sbrk.S
@@ -78,3 +78,5 @@ ENTRY(_sbrk)
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
END(_sbrk)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/shmat.S b/lib/libc/arm/sys/shmat.S
index 3fc3d02..3574b1d 100644
--- a/lib/libc/arm/sys/shmat.S
+++ b/lib/libc/arm/sys/shmat.S
@@ -5,3 +5,5 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
RSYSCALL(shmat)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/sigreturn.S b/lib/libc/arm/sys/sigreturn.S
index 1e0f245..c377e4a 100644
--- a/lib/libc/arm/sys/sigreturn.S
+++ b/lib/libc/arm/sys/sigreturn.S
@@ -40,3 +40,5 @@ __FBSDID("$FreeBSD$");
*/
RSYSCALL(sigreturn)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/arm/sys/syscall.S b/lib/libc/arm/sys/syscall.S
index 73e6b83..c88d1ae 100644
--- a/lib/libc/arm/sys/syscall.S
+++ b/lib/libc/arm/sys/syscall.S
@@ -36,3 +36,5 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
RSYSCALL(syscall)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c
index 4545482..983ff92 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/compat-43/creat.c
@@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$");
__weak_reference(__creat, creat);
__weak_reference(__creat, _creat);
+int __creat(const char *path, mode_t mode);
+
#pragma weak creat
int
__creat(const char *path, mode_t mode)
diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c
index a8cef1c..0848476 100644
--- a/lib/libc/compat-43/sigcompat.c
+++ b/lib/libc/compat-43/sigcompat.c
@@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-sigvec(signo, sv, osv)
- int signo;
- struct sigvec *sv, *osv;
+sigvec(int signo, struct sigvec *sv, struct sigvec *osv)
{
struct sigaction sa, osa;
struct sigaction *sap, *osap;
@@ -69,8 +67,7 @@ sigvec(signo, sv, osv)
}
int
-sigsetmask(mask)
- int mask;
+sigsetmask(int mask)
{
sigset_t set, oset;
int n;
@@ -84,8 +81,7 @@ sigsetmask(mask)
}
int
-sigblock(mask)
- int mask;
+sigblock(int mask)
{
sigset_t set, oset;
int n;
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 42ffb1b..37adaf6 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -56,9 +56,7 @@ __FBSDID("$FreeBSD$");
* NULL on failure
*/
extern DBM *
-dbm_open(file, flags, mode)
- const char *file;
- int flags, mode;
+dbm_open(const char *file, int flags, int mode)
{
HASHINFO info;
char path[MAXPATHLEN];
@@ -80,8 +78,7 @@ dbm_open(file, flags, mode)
}
extern void
-dbm_close(db)
- DBM *db;
+dbm_close(DBM *db)
{
(void)(db->close)(db);
}
@@ -92,9 +89,7 @@ dbm_close(db)
* NULL on failure
*/
extern datum
-dbm_fetch(db, key)
- DBM *db;
- datum key;
+dbm_fetch(DBM *db, datum key)
{
datum retdata;
int status;
@@ -118,8 +113,7 @@ dbm_fetch(db, key)
* NULL on failure
*/
extern datum
-dbm_firstkey(db)
- DBM *db;
+dbm_firstkey(DBM *db)
{
int status;
datum retkey;
@@ -139,8 +133,7 @@ dbm_firstkey(db)
* NULL on failure
*/
extern datum
-dbm_nextkey(db)
- DBM *db;
+dbm_nextkey(DBM *db)
{
int status;
datum retkey;
@@ -160,9 +153,7 @@ dbm_nextkey(db)
* <0 failure
*/
extern int
-dbm_delete(db, key)
- DBM *db;
- datum key;
+dbm_delete(DBM *db, datum key)
{
int status;
DBT dbtkey;
@@ -183,10 +174,7 @@ dbm_delete(db, key)
* 1 if DBM_INSERT and entry exists
*/
extern int
-dbm_store(db, key, data, flags)
- DBM *db;
- datum key, data;
- int flags;
+dbm_store(DBM *db, datum key, datum data, int flags)
{
DBT dbtkey, dbtdata;
@@ -199,8 +187,7 @@ dbm_store(db, key, data, flags)
}
extern int
-dbm_error(db)
- DBM *db;
+dbm_error(DBM *db)
{
HTAB *hp;
@@ -209,8 +196,7 @@ dbm_error(db)
}
extern int
-dbm_clearerr(db)
- DBM *db;
+dbm_clearerr(DBM *db)
{
HTAB *hp;
@@ -220,8 +206,7 @@ dbm_clearerr(db)
}
extern int
-dbm_dirfno(db)
- DBM *db;
+dbm_dirfno(DBM *db)
{
return(((HTAB *)db->internal)->fp);
}
diff --git a/lib/libc/db/recno/rec_open.c b/lib/libc/db/recno/rec_open.c
index dd286c0..8fce730 100644
--- a/lib/libc/db/recno/rec_open.c
+++ b/lib/libc/db/recno/rec_open.c
@@ -64,7 +64,7 @@ __rec_open(const char *fname, int flags, int mode, const RECNOINFO *openinfo,
int rfd, sverrno;
/* Open the user's file -- if this fails, we're done. */
- if (fname != NULL && (rfd = _open(fname, flags, mode)) < 0)
+ if (fname != NULL && (rfd = _open(fname, flags | O_CLOEXEC, mode)) < 0)
return (NULL);
/* Create a btree in memory (backed by disk). */
diff --git a/lib/libc/gdtoa/_ldtoa.c b/lib/libc/gdtoa/_ldtoa.c
index 60c6b22..00d7601 100644
--- a/lib/libc/gdtoa/_ldtoa.c
+++ b/lib/libc/gdtoa/_ldtoa.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <limits.h>
#include <math.h>
#include <stdlib.h>
+#include "../stdio/floatio.h"
#include "fpmath.h"
#include "gdtoaimp.h"
diff --git a/lib/libc/gen/alarm.c b/lib/libc/gen/alarm.c
index 318be4c..439a9e1 100644
--- a/lib/libc/gen/alarm.c
+++ b/lib/libc/gen/alarm.c
@@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
unsigned int
-alarm(secs)
- unsigned int secs;
+alarm(unsigned int secs)
{
struct itimerval it, oitv;
struct itimerval *itp = &it;
diff --git a/lib/libc/gen/assert.c b/lib/libc/gen/assert.c
index 73e199c..ccbc7a4 100644
--- a/lib/libc/gen/assert.c
+++ b/lib/libc/gen/assert.c
@@ -38,10 +38,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
void
-__assert(func, file, line, failedexpr)
- const char *func, *file;
- int line;
- const char *failedexpr;
+__assert(const char *func, const char *file, int line, const char *failedexpr)
{
if (func == NULL)
(void)fprintf(stderr,
diff --git a/lib/libc/gen/clock.c b/lib/libc/gen/clock.c
index b405cda..435e0f8 100644
--- a/lib/libc/gen/clock.c
+++ b/lib/libc/gen/clock.c
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
+ (r).tv_usec / (1000000 / CLOCKS_PER_SEC))
clock_t
-clock()
+clock(void)
{
struct rusage ru;
diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c
index 7d28797..53c9d67 100644
--- a/lib/libc/gen/dlfcn.c
+++ b/lib/libc/gen/dlfcn.c
@@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$");
static char sorry[] = "Service unavailable";
+void _rtld_thread_init(void *);
+void _rtld_atfork_pre(int *);
+void _rtld_atfork_post(int *);
+
/*
* For ELF, the dynamic linker directly resolves references to its
* services to functions inside the dynamic linker itself. These
diff --git a/lib/libc/gen/dup3.c b/lib/libc/gen/dup3.c
index ac8877c..ff3431a 100644
--- a/lib/libc/gen/dup3.c
+++ b/lib/libc/gen/dup3.c
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include "un-namespace.h"
+int __dup3(int, int, int);
+
int
__dup3(int oldfd, int newfd, int flags)
{
diff --git a/lib/libc/gen/elf_utils.c b/lib/libc/gen/elf_utils.c
index 7bd7511..069f62e 100644
--- a/lib/libc/gen/elf_utils.c
+++ b/lib/libc/gen/elf_utils.c
@@ -33,6 +33,9 @@
#include <link.h>
#include <stddef.h>
+int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
+void __pthread_map_stacks_exec(void);
+
int
__elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr)
{
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c
index 0ba584c..a536e5a 100644
--- a/lib/libc/gen/err.c
+++ b/lib/libc/gen/err.c
@@ -79,10 +79,7 @@ _err(int eval, const char *fmt, ...)
}
void
-verr(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
+verr(int eval, const char *fmt, va_list ap)
{
verrc(eval, errno, fmt, ap);
}
diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c
index 4998ee8..c6731f7 100644
--- a/lib/libc/gen/exec.c
+++ b/lib/libc/gen/exec.c
@@ -131,9 +131,7 @@ execlp(const char *name, const char *arg, ...)
}
int
-execv(name, argv)
- const char *name;
- char * const *argv;
+execv(const char *name, char * const *argv)
{
(void)_execve(name, argv, environ);
return (-1);
diff --git a/lib/libc/gen/feature_present.c b/lib/libc/gen/feature_present.c
index 7a2c282..a230c8a 100644
--- a/lib/libc/gen/feature_present.c
+++ b/lib/libc/gen/feature_present.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
/*
* Returns true if the named feature is present in the currently
diff --git a/lib/libc/gen/fmtcheck.c b/lib/libc/gen/fmtcheck.c
index 5b3f2c4..7929f1f 100644
--- a/lib/libc/gen/fmtcheck.c
+++ b/lib/libc/gen/fmtcheck.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
__weak_reference(__fmtcheck, fmtcheck);
+const char * __fmtcheck(const char *, const char *);
enum __e_fmtcheck_types {
FMTCHECK_START,
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index 47d0a41..2f240a8 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -76,9 +76,7 @@ static int fnmatch1(const char *, const char *, const char *, int, mbstate_t,
mbstate_t);
int
-fnmatch(pattern, string, flags)
- const char *pattern, *string;
- int flags;
+fnmatch(const char *pattern, const char *string, int flags)
{
static const mbstate_t initial;
@@ -86,16 +84,17 @@ fnmatch(pattern, string, flags)
}
static int
-fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
- const char *pattern, *string, *stringstart;
- int flags;
- mbstate_t patmbs, strmbs;
+fnmatch1(const char *pattern, const char *string, const char *stringstart,
+ int flags, mbstate_t patmbs, mbstate_t strmbs)
{
+ const char *bt_pattern, *bt_string;
+ mbstate_t bt_patmbs, bt_strmbs;
char *newp;
char c;
wchar_t pc, sc;
size_t pclen, sclen;
+ bt_pattern = bt_string = NULL;
for (;;) {
pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs);
if (pclen == (size_t)-1 || pclen == (size_t)-2)
@@ -111,16 +110,18 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
case EOS:
if ((flags & FNM_LEADING_DIR) && sc == '/')
return (0);
- return (sc == EOS ? 0 : FNM_NOMATCH);
+ if (sc == EOS)
+ return (0);
+ goto backtrack;
case '?':
if (sc == EOS)
return (FNM_NOMATCH);
if (sc == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
+ goto backtrack;
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
string += sclen;
break;
case '*':
@@ -132,7 +133,7 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
/* Optimize for pattern with * at end or before /. */
if (c == EOS)
@@ -148,33 +149,24 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
break;
}
- /* General case, use recursion. */
- while (sc != EOS) {
- if (!fnmatch1(pattern, string, stringstart,
- flags, patmbs, strmbs))
- return (0);
- sclen = mbrtowc(&sc, string, MB_LEN_MAX,
- &strmbs);
- if (sclen == (size_t)-1 ||
- sclen == (size_t)-2) {
- sc = (unsigned char)*string;
- sclen = 1;
- memset(&strmbs, 0, sizeof(strmbs));
- }
- if (sc == '/' && flags & FNM_PATHNAME)
- break;
- string += sclen;
- }
- return (FNM_NOMATCH);
+ /*
+ * First try the shortest match for the '*' that
+ * could work. We can forget any earlier '*' since
+ * there is no way having it match more characters
+ * can help us, given that we are already here.
+ */
+ bt_pattern = pattern, bt_patmbs = patmbs;
+ bt_string = string, bt_strmbs = strmbs;
+ break;
case '[':
if (sc == EOS)
return (FNM_NOMATCH);
if (sc == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
+ goto backtrack;
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
switch (rangematch(pattern, sc, flags, &newp,
&patmbs)) {
@@ -184,7 +176,7 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
pattern = newp;
break;
case RANGE_NOMATCH:
- return (FNM_NOMATCH);
+ goto backtrack;
}
string += sclen;
break;
@@ -199,14 +191,39 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
/* FALLTHROUGH */
default:
norm:
+ string += sclen;
if (pc == sc)
;
else if ((flags & FNM_CASEFOLD) &&
(towlower(pc) == towlower(sc)))
;
- else
- return (FNM_NOMATCH);
- string += sclen;
+ else {
+ backtrack:
+ /*
+ * If we have a mismatch (other than hitting
+ * the end of the string), go back to the last
+ * '*' seen and have it match one additional
+ * character.
+ */
+ if (bt_pattern == NULL)
+ return (FNM_NOMATCH);
+ sclen = mbrtowc(&sc, bt_string, MB_LEN_MAX,
+ &bt_strmbs);
+ if (sclen == (size_t)-1 ||
+ sclen == (size_t)-2) {
+ sc = (unsigned char)*bt_string;
+ sclen = 1;
+ memset(&bt_strmbs, 0,
+ sizeof(bt_strmbs));
+ }
+ if (sc == EOS)
+ return (FNM_NOMATCH);
+ if (sc == '/' && flags & FNM_PATHNAME)
+ return (FNM_NOMATCH);
+ bt_string += sclen;
+ pattern = bt_pattern, patmbs = bt_patmbs;
+ string = bt_string, strmbs = bt_strmbs;
+ }
break;
}
}
@@ -214,12 +231,8 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
}
static int
-rangematch(pattern, test, flags, newp, patmbs)
- const char *pattern;
- wchar_t test;
- int flags;
- char **newp;
- mbstate_t *patmbs;
+rangematch(const char *pattern, wchar_t test, int flags, char **newp,
+ mbstate_t *patmbs)
{
int negate, ok;
wchar_t c, c2;
diff --git a/lib/libc/gen/ftok.c b/lib/libc/gen/ftok.c
index 4269e37..2fad66e 100644
--- a/lib/libc/gen/ftok.c
+++ b/lib/libc/gen/ftok.c
@@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/ipc.h>
key_t
-ftok(path, id)
- const char *path;
- int id;
+ftok(const char *path, int id)
{
struct stat st;
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c
index 1be41da..51b6c26 100644
--- a/lib/libc/gen/fts-compat.c
+++ b/lib/libc/gen/fts-compat.c
@@ -120,10 +120,8 @@ static const char *ufslike_filesystems[] = {
};
FTS *
-__fts_open_44bsd(argv, options, compar)
- char * const *argv;
- int options;
- int (*compar)(const FTSENT * const *, const FTSENT * const *);
+__fts_open_44bsd(char * const *argv, int options,
+ int (*compar)(const FTSENT * const *, const FTSENT * const *))
{
struct _fts_private *priv;
FTS *sp;
@@ -139,9 +137,8 @@ __fts_open_44bsd(argv, options, compar)
}
/* Allocate/initialize the stream. */
- if ((priv = malloc(sizeof(*priv))) == NULL)
+ if ((priv = calloc(1, sizeof(*priv))) == NULL)
return (NULL);
- memset(priv, 0, sizeof(*priv));
sp = &priv->ftsp_fts;
sp->fts_compar = compar;
sp->fts_options = options;
@@ -234,9 +231,7 @@ mem1: free(sp);
}
static void
-fts_load(sp, p)
- FTS *sp;
- FTSENT *p;
+fts_load(FTS *sp, FTSENT *p)
{
int len;
char *cp;
@@ -260,8 +255,7 @@ fts_load(sp, p)
}
int
-__fts_close_44bsd(sp)
- FTS *sp;
+__fts_close_44bsd(FTS *sp)
{
FTSENT *freep, *p;
int saved_errno;
@@ -315,8 +309,7 @@ __fts_close_44bsd(sp)
? p->fts_pathlen - 1 : p->fts_pathlen)
FTSENT *
-__fts_read_44bsd(sp)
- FTS *sp;
+__fts_read_44bsd(FTS *sp)
{
FTSENT *p, *tmp;
int instr;
@@ -510,10 +503,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
*/
/* ARGSUSED */
int
-__fts_set_44bsd(sp, p, instr)
- FTS *sp;
- FTSENT *p;
- int instr;
+__fts_set_44bsd(FTS *sp, FTSENT *p, int instr)
{
if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
@@ -525,9 +515,7 @@ __fts_set_44bsd(sp, p, instr)
}
FTSENT *
-__fts_children_44bsd(sp, instr)
- FTS *sp;
- int instr;
+__fts_children_44bsd(FTS *sp, int instr)
{
FTSENT *p;
int fd;
@@ -635,9 +623,7 @@ __fts_set_clientptr_44bsd(FTS *sp, void *clientptr)
* been found, cutting the stat calls by about 2/3.
*/
static FTSENT *
-fts_build(sp, type)
- FTS *sp;
- int type;
+fts_build(FTS *sp, int type)
{
struct dirent *dp;
FTSENT *p, *head;
@@ -901,10 +887,7 @@ mem1: saved_errno = errno;
}
static u_short
-fts_stat(sp, p, follow)
- FTS *sp;
- FTSENT *p;
- int follow;
+fts_stat(FTS *sp, FTSENT *p, int follow)
{
FTSENT *t;
dev_t dev;
@@ -999,10 +982,7 @@ fts_compar(const void *a, const void *b)
}
static FTSENT *
-fts_sort(sp, head, nitems)
- FTS *sp;
- FTSENT *head;
- int nitems;
+fts_sort(FTS *sp, FTSENT *head, int nitems)
{
FTSENT **ap, *p;
@@ -1031,10 +1011,7 @@ fts_sort(sp, head, nitems)
}
static FTSENT *
-fts_alloc(sp, name, namelen)
- FTS *sp;
- char *name;
- int namelen;
+fts_alloc(FTS *sp, char *name, int namelen)
{
FTSENT *p;
size_t len;
@@ -1081,8 +1058,7 @@ fts_alloc(sp, name, namelen)
}
static void
-fts_lfree(head)
- FTSENT *head;
+fts_lfree(FTSENT *head)
{
FTSENT *p;
@@ -1100,9 +1076,7 @@ fts_lfree(head)
* plus 256 bytes so don't realloc the path 2 bytes at a time.
*/
static int
-fts_palloc(sp, more)
- FTS *sp;
- size_t more;
+fts_palloc(FTS *sp, size_t more)
{
sp->fts_pathlen += more + 256;
@@ -1127,9 +1101,7 @@ fts_palloc(sp, more)
* already returned.
*/
static void
-fts_padjust(sp, head)
- FTS *sp;
- FTSENT *head;
+fts_padjust(FTS *sp, FTSENT *head)
{
FTSENT *p;
char *addr = sp->fts_path;
@@ -1153,8 +1125,7 @@ fts_padjust(sp, head)
}
static size_t
-fts_maxarglen(argv)
- char * const *argv;
+fts_maxarglen(char * const *argv)
{
size_t len, max;
@@ -1170,11 +1141,7 @@ fts_maxarglen(argv)
* Assumes p->fts_dev and p->fts_ino are filled in.
*/
static int
-fts_safe_changedir(sp, p, fd, path)
- FTS *sp;
- FTSENT *p;
- int fd;
- char *path;
+fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
{
int ret, oerrno, newfd;
struct stat sb;
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 8083a88..03ef5c8 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -110,10 +110,8 @@ static const char *ufslike_filesystems[] = {
};
FTS *
-fts_open(argv, options, compar)
- char * const *argv;
- int options;
- int (*compar)(const FTSENT * const *, const FTSENT * const *);
+fts_open(char * const *argv, int options,
+ int (*compar)(const FTSENT * const *, const FTSENT * const *))
{
struct _fts_private *priv;
FTS *sp;
@@ -1105,8 +1103,7 @@ fts_padjust(FTS *sp, FTSENT *head)
}
static size_t
-fts_maxarglen(argv)
- char * const *argv;
+fts_maxarglen(char * const *argv)
{
size_t len, max;
diff --git a/lib/libc/gen/getbsize.c b/lib/libc/gen/getbsize.c
index 7e88e3f..bbf5b1e 100644
--- a/lib/libc/gen/getbsize.c
+++ b/lib/libc/gen/getbsize.c
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
char *
-getbsize(headerlenp, blocksizep)
- int *headerlenp;
- long *blocksizep;
+getbsize(int *headerlenp, long *blocksizep)
{
static char header[20];
long n, max, mul, blocksize;
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index da76d56..6884897 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$");
extern int __getcwd(char *, size_t);
char *
-getcwd(pt, size)
- char *pt;
- size_t size;
+getcwd(char *pt, size_t size)
{
struct dirent *dp;
DIR *dir = NULL;
diff --git a/lib/libc/gen/getdomainname.c b/lib/libc/gen/getdomainname.c
index 21eb66d..5a38857 100644
--- a/lib/libc/gen/getdomainname.c
+++ b/lib/libc/gen/getdomainname.c
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
-getdomainname(name, namelen)
- char *name;
- int namelen;
+getdomainname(char *name, int namelen)
{
int mib[2];
size_t size;
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 1f4d7e9..31d2af1 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -75,6 +75,7 @@ static const ns_src defaultsrc[] = {
{ NULL, 0 }
};
+int __getgroupmembership(const char *, gid_t, gid_t *, int, int *);
int __gr_match_entry(const char *, size_t, enum nss_lookup_type,
const char *, gid_t);
int __gr_parse_entry(char *, size_t, struct group *, char *, size_t,
@@ -1238,7 +1239,7 @@ compat_setgrent(void *retval, void *mdata, va_list ap)
int rv, stayopen;
#define set_setent(x, y) do { \
- int i; \
+ unsigned int i; \
\
for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \
x[i].mdata = (void *)y; \
@@ -1308,7 +1309,7 @@ compat_group(void *retval, void *mdata, va_list ap)
int rv, stayopen, *errnop;
#define set_lookup_type(x, y) do { \
- int i; \
+ unsigned int i; \
\
for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \
x[i].mdata = (void *)y; \
diff --git a/lib/libc/gen/gethostname.c b/lib/libc/gen/gethostname.c
index c83805e..dc2b372 100644
--- a/lib/libc/gen/gethostname.c
+++ b/lib/libc/gen/gethostname.c
@@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
-gethostname(name, namelen)
- char *name;
- size_t namelen;
+gethostname(char *name, size_t namelen)
{
int mib[2];
diff --git a/lib/libc/gen/getloadavg.c b/lib/libc/gen/getloadavg.c
index 127d3e8..9c06d0a 100644
--- a/lib/libc/gen/getloadavg.c
+++ b/lib/libc/gen/getloadavg.c
@@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
* Return number of samples retrieved, or -1 on error.
*/
int
-getloadavg(loadavg, nelem)
- double loadavg[];
- int nelem;
+getloadavg(double loadavg[], int nelem)
{
struct loadavg loadinfo;
int i, mib[2];
diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c
index 2b532f6..99f82aa 100644
--- a/lib/libc/gen/getmntinfo.c
+++ b/lib/libc/gen/getmntinfo.c
@@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$");
* Return information about mounted filesystems.
*/
int
-getmntinfo(mntbufp, flags)
- struct statfs **mntbufp;
- int flags;
+getmntinfo(struct statfs **mntbufp, int flags)
{
static struct statfs *mntbuf;
static int mntsize;
diff --git a/lib/libc/gen/getpagesize.c b/lib/libc/gen/getpagesize.c
index f4b8128..da2eb69 100644
--- a/lib/libc/gen/getpagesize.c
+++ b/lib/libc/gen/getpagesize.c
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
*/
int
-getpagesize()
+getpagesize(void)
{
int mib[2];
static int value;
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 09a6247..6546f587 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -1607,7 +1607,8 @@ compat_redispatch(struct compat_state *st, enum nss_lookup_type how,
{ NULL, NULL, NULL }
};
void *discard;
- int rv, e, i;
+ int rv, e;
+ unsigned int i;
for (i = 0; i < sizeof(dtab)/sizeof(dtab[0]) - 1; i++)
dtab[i].mdata = (void *)lookup_how;
@@ -1702,7 +1703,7 @@ compat_setpwent(void *retval, void *mdata, va_list ap)
int rv, stayopen;
#define set_setent(x, y) do { \
- int i; \
+ unsigned int i; \
\
for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \
x[i].mdata = (void *)y; \
diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c
index 53536e1..6e78286 100644
--- a/lib/libc/gen/getusershell.c
+++ b/lib/libc/gen/getusershell.c
@@ -102,10 +102,7 @@ static int _local_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
-_local_initshells(rv, cb_data, ap)
- void *rv;
- void *cb_data;
- va_list ap;
+_local_initshells(void *rv, void *cb_data, va_list ap)
{
char *sp, *cp;
FILE *fp;
@@ -139,10 +136,7 @@ static int _dns_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
-_dns_initshells(rv, cb_data, ap)
- void *rv;
- void *cb_data;
- va_list ap;
+_dns_initshells(void *rv, void *cb_data, va_list ap)
{
char shellname[] = "shells-XXXXX";
int hsindex, hpi, r;
@@ -183,10 +177,7 @@ static int _nis_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
-_nis_initshells(rv, cb_data, ap)
- void *rv;
- void *cb_data;
- va_list ap;
+_nis_initshells(void *rv, void *cb_data, va_list ap)
{
static char *ypdomain;
char *key, *data;
@@ -239,7 +230,7 @@ _nis_initshells(rv, cb_data, ap)
#endif /* YP */
static const char *const *
-initshells()
+initshells(void)
{
static const ns_dtab dtab[] = {
NS_FILES_CB(_local_initshells, NULL)
diff --git a/lib/libc/gen/getvfsbyname.c b/lib/libc/gen/getvfsbyname.c
index 0d896bb..c90c5ee 100644
--- a/lib/libc/gen/getvfsbyname.c
+++ b/lib/libc/gen/getvfsbyname.c
@@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
* and if it is resident, return its xvfsconf structure.
*/
int
-getvfsbyname(fsname, vfcp)
- const char *fsname;
- struct xvfsconf *vfcp;
+getvfsbyname(const char *fsname, struct xvfsconf *vfcp)
{
struct xvfsconf *xvfsp;
size_t buflen;
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index 95a3a06..971d616 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -650,13 +650,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
int err;
char buf[MAXPATHLEN];
- /*
- * The readdirfunc declaration can't be prototyped, because it is
- * assigned, below, to two functions which are prototyped in glob.h
- * and dirent.h as taking pointers to differently typed opaque
- * structures.
- */
- struct dirent *(*readdirfunc)();
+ struct dirent *(*readdirfunc)(DIR *);
if (pathend > pathend_last)
return (GLOB_ABORTED);
@@ -677,12 +671,14 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
err = 0;
- /* Search directory for matching names. */
+ /* pglob->gl_readdir takes a void *, fix this manually */
if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- readdirfunc = pglob->gl_readdir;
+ readdirfunc = (struct dirent *(*)(DIR *))pglob->gl_readdir;
else
readdirfunc = readdir;
- while ((dp = (*readdirfunc)(dirp))) {
+
+ /* Search directory for matching names. */
+ while ((dp = (*readdirfunc)(dirp)) != NULL) {
char *sc;
Char *dc;
wchar_t wc;
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index aacaf7e..d6a644c 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
-initgroups(uname, agroup)
- const char *uname;
- gid_t agroup;
+initgroups(const char *uname, gid_t agroup)
{
int ngroups, ret;
long ngroups_max;
diff --git a/lib/libc/gen/isatty.c b/lib/libc/gen/isatty.c
index 076b824..02b0ffd 100644
--- a/lib/libc/gen/isatty.c
+++ b/lib/libc/gen/isatty.c
@@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
-isatty(fd)
- int fd;
+isatty(int fd)
{
int retval;
struct termios t;
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index ec878c5..e93f89b 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -61,11 +61,10 @@ __FBSDID("$FreeBSD$");
int __fdnlist(int, struct nlist *);
int __aout_fdnlist(int, struct nlist *);
int __elf_fdnlist(int, struct nlist *);
+int __elf_is_okay__(Elf_Ehdr *);
int
-nlist(name, list)
- const char *name;
- struct nlist *list;
+nlist(const char *name, struct nlist *list)
{
int fd, n;
@@ -89,11 +88,10 @@ static struct nlist_handlers {
};
int
-__fdnlist(fd, list)
- int fd;
- struct nlist *list;
+__fdnlist(int fd, struct nlist *list)
{
- int n = -1, i;
+ int n = -1;
+ unsigned int i;
for (i = 0; i < sizeof(nlist_fn) / sizeof(nlist_fn[0]); i++) {
n = (nlist_fn[i].fn)(fd, list);
@@ -107,9 +105,7 @@ __fdnlist(fd, list)
#ifdef _NLIST_DO_AOUT
int
-__aout_fdnlist(fd, list)
- int fd;
- struct nlist *list;
+__aout_fdnlist(int fd, struct nlist *list)
{
struct nlist *p, *symtab;
caddr_t strtab, a_out_mmap;
@@ -235,9 +231,7 @@ __elf_is_okay__(Elf_Ehdr *ehdr)
}
int
-__elf_fdnlist(fd, list)
- int fd;
- struct nlist *list;
+__elf_fdnlist(int fd, struct nlist *list)
{
struct nlist *p;
Elf_Off symoff = 0, symstroff = 0;
@@ -377,11 +371,7 @@ __elf_fdnlist(fd, list)
* n_value and n_type members.
*/
static void
-elf_sym_to_nlist(nl, s, shdr, shnum)
- struct nlist *nl;
- Elf_Sym *s;
- Elf_Shdr *shdr;
- int shnum;
+elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum)
{
nl->n_value = s->st_value;
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c
index ef48c1c..8e7a638 100644
--- a/lib/libc/gen/pause.c
+++ b/lib/libc/gen/pause.c
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+int __pause(void);
+
/*
* Backwards compatible pause.
*/
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index e54bb5c..a7a9708 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -67,8 +67,7 @@ static pthread_mutex_t pidlist_mutex = PTHREAD_MUTEX_INITIALIZER;
#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&pidlist_mutex)
FILE *
-popen(command, type)
- const char *command, *type;
+popen(const char *command, const char *type)
{
struct pid *cur;
FILE *iop;
@@ -179,8 +178,7 @@ popen(command, type)
* if already `pclosed', or waitpid returns an error.
*/
int
-pclose(iop)
- FILE *iop;
+pclose(FILE *iop)
{
struct pid *cur, *last = NULL;
int pstat;
diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c
index 6fca4b1..5c5aada 100644
--- a/lib/libc/gen/psignal.c
+++ b/lib/libc/gen/psignal.c
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
void
-psignal(sig, s)
- unsigned int sig;
- const char *s;
+psignal(unsigned int sig, const char *s)
{
const char *c;
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index 994fea5..4bc895e 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
__weak_reference(__raise, raise);
__weak_reference(__raise, _raise);
+int __raise(int);
int
__raise(int s)
diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c
index c6f5d3f..b5162ed 100644
--- a/lib/libc/gen/readdir.c
+++ b/lib/libc/gen/readdir.c
@@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
* get next entry in a directory.
*/
struct dirent *
-_readdir_unlocked(dirp, skip)
- DIR *dirp;
- int skip;
+_readdir_unlocked(DIR *dirp, int skip)
{
struct dirent *dp;
long initial_seek;
@@ -91,8 +89,7 @@ _readdir_unlocked(dirp, skip)
}
struct dirent *
-readdir(dirp)
- DIR *dirp;
+readdir(DIR *dirp)
{
struct dirent *dp;
@@ -107,10 +104,7 @@ readdir(dirp)
}
int
-readdir_r(dirp, entry, result)
- DIR *dirp;
- struct dirent *entry;
- struct dirent **result;
+readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
{
struct dirent *dp;
int saved_errno;
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index e157cd6..2421c47 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$");
#include "telldir.h"
void
-rewinddir(dirp)
- DIR *dirp;
+rewinddir(DIR *dirp)
{
if (__isthreaded)
diff --git a/lib/libc/gen/seekdir.c b/lib/libc/gen/seekdir.c
index e9851a7..699de46 100644
--- a/lib/libc/gen/seekdir.c
+++ b/lib/libc/gen/seekdir.c
@@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
* _seekdir is in telldir.c so that it can share opaque data structures.
*/
void
-seekdir(dirp, loc)
- DIR *dirp;
- long loc;
+seekdir(DIR *dirp, long loc)
{
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
diff --git a/lib/libc/gen/semctl.c b/lib/libc/gen/semctl.c
index 156d18c..c68734d 100644
--- a/lib/libc/gen/semctl.c
+++ b/lib/libc/gen/semctl.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
int __semctl(int semid, int semnum, int cmd, union semun *arg);
int freebsd7___semctl(int semid, int semnum, int cmd, union semun_old *arg);
+int freebsd7_semctl(int semid, int semnum, int cmd, ...);
int
semctl(int semid, int semnum, int cmd, ...)
diff --git a/lib/libc/gen/setjmperr.c b/lib/libc/gen/setjmperr.c
index 3cfeb55..90fa4aa 100644
--- a/lib/libc/gen/setjmperr.c
+++ b/lib/libc/gen/setjmperr.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
void
-longjmperror()
+longjmperror(void)
{
#define ERRMSG "longjmp botch.\n"
(void)_write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1);
diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c
index cf7e688..cbcbfec 100644
--- a/lib/libc/gen/sigsetops.c
+++ b/lib/libc/gen/sigsetops.c
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
int
-sigaddset(set, signo)
- sigset_t *set;
- int signo;
+sigaddset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
@@ -53,9 +51,7 @@ sigaddset(set, signo)
}
int
-sigdelset(set, signo)
- sigset_t *set;
- int signo;
+sigdelset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
@@ -67,8 +63,7 @@ sigdelset(set, signo)
}
int
-sigemptyset(set)
- sigset_t *set;
+sigemptyset(sigset_t *set)
{
int i;
@@ -78,8 +73,7 @@ sigemptyset(set)
}
int
-sigfillset(set)
- sigset_t *set;
+sigfillset(sigset_t *set)
{
int i;
@@ -89,9 +83,7 @@ sigfillset(set)
}
int
-sigismember(set, signo)
- const sigset_t *set;
- int signo;
+sigismember(const sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index 6bb4ecd..6c33c35 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+unsigned int __sleep(unsigned int);
+
unsigned int
__sleep(unsigned int seconds)
{
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c
index 55e9945..dba9cd2 100644
--- a/lib/libc/gen/strtofflags.c
+++ b/lib/libc/gen/strtofflags.c
@@ -94,14 +94,13 @@ static struct {
* are set, return the empty string.
*/
char *
-fflagstostr(flags)
- u_long flags;
+fflagstostr(u_long flags)
{
char *string;
const char *sp;
char *dp;
u_long setflags;
- int i;
+ u_int i;
if ((string = (char *)malloc(nmappings * (longestflaglen + 1))) == NULL)
return (NULL);
@@ -128,9 +127,7 @@ fflagstostr(flags)
* to the offending token.
*/
int
-strtofflags(stringp, setp, clrp)
- char **stringp;
- u_long *setp, *clrp;
+strtofflags(char **stringp, u_long *setp, u_long *clrp)
{
char *string, *p;
int i;
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 2b3acfb..be3d4af 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -69,8 +69,7 @@ __FBSDID("$FreeBSD$");
* less useful than returning up-to-date values, however.
*/
long
-sysconf(name)
- int name;
+sysconf(int name)
{
struct rlimit rl;
size_t len;
diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c
index 19cd6ee..3e5678c 100644
--- a/lib/libc/gen/telldir.c
+++ b/lib/libc/gen/telldir.c
@@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$");
* return a pointer into a directory
*/
long
-telldir(dirp)
- DIR *dirp;
+telldir(DIR *dirp)
{
struct ddloc *lp;
long idx;
@@ -86,9 +85,7 @@ telldir(dirp)
* Only values returned by "telldir" should be passed to seekdir.
*/
void
-_seekdir(dirp, loc)
- DIR *dirp;
- long loc;
+_seekdir(DIR *dirp, long loc)
{
struct ddloc *lp;
struct dirent *dp;
@@ -152,8 +149,7 @@ _fixtelldir(DIR *dirp, long oldseek, long oldloc)
* Reclaim memory for telldir cookies which weren't used.
*/
void
-_reclaim_telldir(dirp)
- DIR *dirp;
+_reclaim_telldir(DIR *dirp)
{
struct ddloc *lp;
struct ddloc *templp;
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 73eb9a2..ca4d696 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -270,7 +270,7 @@ __libc_free_tls(void *tcb __unused, size_t tcbsize __unused,
extern char **environ;
void
-_init_tls()
+_init_tls(void)
{
#ifndef PIC
Elf_Addr *sp;
diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c
index 1de0837..397e3ad 100644
--- a/lib/libc/gen/ttyslot.c
+++ b/lib/libc/gen/ttyslot.c
@@ -33,6 +33,8 @@ static char sccsid[] = "@(#)ttyslot.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+int __ttyslot(void);
+
int
__ttyslot(void)
{
diff --git a/lib/libc/gen/ualarm.c b/lib/libc/gen/ualarm.c
index bf75775..6a1dca7 100644
--- a/lib/libc/gen/ualarm.c
+++ b/lib/libc/gen/ualarm.c
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
* every ``reload'' microseconds after the first signal.
*/
useconds_t
-ualarm(usecs, reload)
- useconds_t usecs;
- useconds_t reload;
+ualarm(useconds_t usecs, useconds_t reload)
{
struct itimerval new, old;
diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c
index 5a7baf7..499f761 100644
--- a/lib/libc/gen/uname.c
+++ b/lib/libc/gen/uname.c
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#undef uname
+int uname(struct utsname *);
+
int
uname(struct utsname *name)
{
diff --git a/lib/libc/gen/unvis-compat.c b/lib/libc/gen/unvis-compat.c
index 080143e..5fa5ca9 100644
--- a/lib/libc/gen/unvis-compat.c
+++ b/lib/libc/gen/unvis-compat.c
@@ -34,6 +34,8 @@
#define _UNVIS_END 1
+int __unvis_44bsd(char *, int, int *, int);
+
int
__unvis_44bsd(char *cp, int c, int *astate, int flag)
{
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 7c35f6c..90be6d4 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+int __usleep(useconds_t);
+
int
__usleep(useconds_t useconds)
{
diff --git a/lib/libc/gen/utime.c b/lib/libc/gen/utime.c
index 97bf878..0250a7a 100644
--- a/lib/libc/gen/utime.c
+++ b/lib/libc/gen/utime.c
@@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$");
#include <utime.h>
int
-utime(path, times)
- const char *path;
- const struct utimbuf *times;
+utime(const char *path, const struct utimbuf *times)
{
struct timeval tv[2], *tvp;
diff --git a/lib/libc/gen/wait.c b/lib/libc/gen/wait.c
index 46a3fdd..7cede6e 100644
--- a/lib/libc/gen/wait.c
+++ b/lib/libc/gen/wait.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+pid_t __wait(int *);
+
pid_t
__wait(int *istat)
{
diff --git a/lib/libc/gen/wait3.c b/lib/libc/gen/wait3.c
index 965effe..b50e3dd 100644
--- a/lib/libc/gen/wait3.c
+++ b/lib/libc/gen/wait3.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+pid_t __wait3(int *, int, struct rusage *);
+
pid_t
__wait3(int *istat, int options, struct rusage *rup)
{
diff --git a/lib/libc/gen/waitid.c b/lib/libc/gen/waitid.c
index 17a2dd6..8bdd652 100644
--- a/lib/libc/gen/waitid.c
+++ b/lib/libc/gen/waitid.c
@@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
+int __waitid(idtype_t, id_t, siginfo_t *, int);
+
int
__waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
{
diff --git a/lib/libc/gen/waitpid.c b/lib/libc/gen/waitpid.c
index 5177591..5dc4fa8 100644
--- a/lib/libc/gen/waitpid.c
+++ b/lib/libc/gen/waitpid.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
+pid_t __waitpid(pid_t, int *, int);
+
pid_t
__waitpid(pid_t pid, int *istat, int options)
{
diff --git a/lib/libc/gen/wordexp.3 b/lib/libc/gen/wordexp.3
index 2fc20ef..dd4605f 100644
--- a/lib/libc/gen/wordexp.3
+++ b/lib/libc/gen/wordexp.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 18, 2015
+.Dd September 30, 2015
.Dt WORDEXP 3
.Os
.Sh NAME
@@ -108,8 +108,9 @@ function frees the memory allocated by
.Sh IMPLEMENTATION NOTES
The
.Fn wordexp
-function is implemented by executing
-.Xr sh 1 .
+function is implemented using the undocumented
+.Ic freebsd_wordexp
+shell built-in command.
.Sh RETURN VALUES
The
.Fn wordexp
@@ -191,18 +192,19 @@ and
functions conform to
.St -p1003.1-2001 .
.Sh BUGS
-Do not pass untrusted user data to
-.Fn wordexp ,
-regardless of whether the
-.Dv WRDE_NOCMD
-flag is set.
-The
-.Fn wordexp
-function attempts to detect input that would cause commands to be
-executed before passing it to the shell
-but it does not use the same parser so it may be fooled.
-.Pp
The current
.Fn wordexp
implementation does not recognize multibyte characters other than UTF-8, since
the shell (which it invokes to perform expansions) does not.
+.Sh SECURITY CONSIDERATIONS
+Pathname generation may create output that is exponentially larger than the
+input size.
+.Pp
+Although this implementation detects command substitution reliably for
+.Dv WRDE_NOCMD ,
+the attack surface remains fairly large.
+Also, some other implementations
+(such as older versions of this one)
+may execute command substitutions even if
+.Dv WRDE_NOCMD
+is set.
diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c
index 859ca50..3791e1e 100644
--- a/lib/libc/gen/wordexp.c
+++ b/lib/libc/gen/wordexp.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <paths.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -43,7 +44,7 @@
__FBSDID("$FreeBSD$");
static int we_askshell(const char *, wordexp_t *, int);
-static int we_check(const char *, int);
+static int we_check(const char *);
/*
* wordexp --
@@ -65,7 +66,7 @@ wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags)
we->we_strings = NULL;
we->we_nbytes = 0;
}
- if ((error = we_check(words, flags)) != 0) {
+ if ((error = we_check(words)) != 0) {
wordfree(we);
return (error);
}
@@ -94,17 +95,37 @@ we_read_fully(int fd, char *buffer, size_t len)
return done;
}
+static bool
+we_write_fully(int fd, const char *buffer, size_t len)
+{
+ size_t done;
+ ssize_t nwritten;
+
+ done = 0;
+ do {
+ nwritten = _write(fd, buffer + done, len - done);
+ if (nwritten == -1 && errno == EINTR)
+ continue;
+ if (nwritten <= 0)
+ return (false);
+ done += nwritten;
+ } while (done != len);
+ return (true);
+}
+
/*
* we_askshell --
- * Use the `wordexp' /bin/sh builtin function to do most of the work
- * in expanding the word string. This function is complicated by
+ * Use the `freebsd_wordexp' /bin/sh builtin function to do most of the
+ * work in expanding the word string. This function is complicated by
* memory management.
*/
static int
we_askshell(const char *words, wordexp_t *we, int flags)
{
- int pdes[2]; /* Pipe to child */
- char buf[18]; /* Buffer for byte and word count */
+ int pdesw[2]; /* Pipe for writing words */
+ int pdes[2]; /* Pipe for reading output */
+ char wfdstr[sizeof(int) * 3 + 1];
+ char buf[35]; /* Buffer for byte and word count */
long nwords, nbytes; /* Number of words, bytes from child */
long i; /* Handy integer */
size_t sofs; /* Offset into we->we_strings */
@@ -119,18 +140,25 @@ we_askshell(const char *words, wordexp_t *we, int flags)
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
const char *ifs;
- char save;
serrno = errno;
ifs = getenv("IFS");
- if (pipe2(pdes, O_CLOEXEC) < 0)
+ if (pipe2(pdesw, O_CLOEXEC) < 0)
+ return (WRDE_NOSPACE); /* XXX */
+ snprintf(wfdstr, sizeof(wfdstr), "%d", pdesw[0]);
+ if (pipe2(pdes, O_CLOEXEC) < 0) {
+ _close(pdesw[0]);
+ _close(pdesw[1]);
return (WRDE_NOSPACE); /* XXX */
+ }
(void)sigemptyset(&newsigblock);
(void)sigaddset(&newsigblock, SIGCHLD);
(void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
if ((pid = fork()) < 0) {
serrno = errno;
+ _close(pdesw[0]);
+ _close(pdesw[1]);
_close(pdes[0]);
_close(pdes[1]);
(void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
@@ -146,43 +174,54 @@ we_askshell(const char *words, wordexp_t *we, int flags)
_dup2(pdes[1], STDOUT_FILENO) :
_fcntl(pdes[1], F_SETFD, 0)) < 0)
_exit(1);
+ if (_fcntl(pdesw[0], F_SETFD, 0) < 0)
+ _exit(1);
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
- "-c", "IFS=$1;eval \"$2\";eval \"echo;set -- $3\";"
- "IFS=;a=\"$*\";printf '%08x' \"$#\" \"${#a}\";"
- "printf '%s\\0' \"$@\"",
+ "-c", "IFS=$1;eval \"$2\";"
+ "freebsd_wordexp -f \"$3\" ${4:+\"$4\"}",
"",
ifs != NULL ? ifs : " \t\n",
- flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words,
+ flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null",
+ wfdstr,
+ flags & WRDE_NOCMD ? "-p" : "",
(char *)NULL);
_exit(1);
}
/*
- * We are the parent; read the output of the shell wordexp function,
- * which is a byte indicating that the words were parsed successfully,
- * a 32-bit hexadecimal word count, a 32-bit hexadecimal byte count
- * (not including terminating null bytes), followed by the expanded
- * words separated by nulls.
+ * We are the parent; write the words.
*/
_close(pdes[1]);
- switch (we_read_fully(pdes[0], buf, 17)) {
+ _close(pdesw[0]);
+ if (!we_write_fully(pdesw[1], words, strlen(words))) {
+ _close(pdesw[1]);
+ error = WRDE_SYNTAX;
+ goto cleanup;
+ }
+ _close(pdesw[1]);
+ /*
+ * Read the output of the shell wordexp function,
+ * which is a byte indicating that the words were parsed successfully,
+ * a 64-bit hexadecimal word count, a dummy byte, a 64-bit hexadecimal
+ * byte count (not including terminating null bytes), followed by the
+ * expanded words separated by nulls.
+ */
+ switch (we_read_fully(pdes[0], buf, 34)) {
case 1:
- error = WRDE_BADVAL;
+ error = buf[0] == 'C' ? WRDE_CMDSUB : WRDE_BADVAL;
serrno = errno;
goto cleanup;
- case 17:
+ case 34:
break;
default:
error = WRDE_SYNTAX;
serrno = errno;
goto cleanup;
}
- save = buf[9];
- buf[9] = '\0';
- nwords = strtol(buf + 1, NULL, 16);
- buf[9] = save;
buf[17] = '\0';
- nbytes = strtol(buf + 9, NULL, 16) + nwords;
+ nwords = strtol(buf + 1, NULL, 16);
+ buf[34] = '\0';
+ nbytes = strtol(buf + 18, NULL, 16) + nwords;
/*
* Allocate or reallocate (when flags & WRDE_APPEND) the word vector
@@ -255,83 +294,96 @@ cleanup:
* we_check --
* Check that the string contains none of the following unquoted
* special characters: <newline> |&;<>(){}
- * or command substitutions when WRDE_NOCMD is set in flags.
+ * This mainly serves for {} which are normally legal in sh.
+ * It deliberately does not attempt to model full sh syntax.
*/
static int
-we_check(const char *words, int flags)
+we_check(const char *words)
{
char c;
- int dquote, level, quote, squote;
+ /* Saw \ or $, possibly not special: */
+ bool quote = false, dollar = false;
+ /* Saw ', ", ${, ` or $(, possibly not special: */
+ bool have_sq = false, have_dq = false, have_par_begin = false;
+ bool have_cmd = false;
+ /* Definitely saw a ', ", ${, ` or $(, need a closing character: */
+ bool need_sq = false, need_dq = false, need_par_end = false;
+ bool need_cmd_old = false, need_cmd_new = false;
- quote = squote = dquote = 0;
while ((c = *words++) != '\0') {
switch (c) {
case '\\':
- if (squote == 0)
- quote ^= 1;
+ quote = !quote;
+ continue;
+ case '$':
+ if (quote)
+ quote = false;
+ else
+ dollar = !dollar;
continue;
case '\'':
- if (quote + dquote == 0)
- squote ^= 1;
+ if (!quote && !have_sq && !have_dq)
+ need_sq = true;
+ else
+ need_sq = false;
+ have_sq = true;
break;
case '"':
- if (quote + squote == 0)
- dquote ^= 1;
+ if (!quote && !have_sq && !have_dq)
+ need_dq = true;
+ else
+ need_dq = false;
+ have_dq = true;
break;
case '`':
- if (quote + squote == 0 && flags & WRDE_NOCMD)
- return (WRDE_CMDSUB);
- while ((c = *words++) != '\0' && c != '`')
- if (c == '\\' && (c = *words++) == '\0')
- break;
- if (c == '\0')
- return (WRDE_SYNTAX);
+ if (!quote && !have_sq && !have_cmd)
+ need_cmd_old = true;
+ else
+ need_cmd_old = false;
+ have_cmd = true;
break;
- case '|': case '&': case ';': case '<': case '>':
- case '{': case '}': case '(': case ')': case '\n':
- if (quote + squote + dquote == 0)
+ case '{':
+ if (!quote && !dollar && !have_sq && !have_dq &&
+ !have_cmd)
return (WRDE_BADCHAR);
+ if (dollar) {
+ if (!quote && !have_sq)
+ need_par_end = true;
+ have_par_begin = true;
+ }
break;
- case '$':
- if ((c = *words++) == '\0')
- break;
- else if (quote + squote == 0 && c == '(') {
- if (flags & WRDE_NOCMD && *words != '(')
- return (WRDE_CMDSUB);
- level = 1;
- while ((c = *words++) != '\0') {
- if (c == '\\') {
- if ((c = *words++) == '\0')
- break;
- } else if (c == '(')
- level++;
- else if (c == ')' && --level == 0)
- break;
- }
- if (c == '\0' || level != 0)
- return (WRDE_SYNTAX);
- } else if (quote + squote == 0 && c == '{') {
- level = 1;
- while ((c = *words++) != '\0') {
- if (c == '\\') {
- if ((c = *words++) == '\0')
- break;
- } else if (c == '{')
- level++;
- else if (c == '}' && --level == 0)
- break;
- }
- if (c == '\0' || level != 0)
- return (WRDE_SYNTAX);
- } else
- --words;
+ case '}':
+ if (!quote && !have_sq && !have_dq && !have_par_begin &&
+ !have_cmd)
+ return (WRDE_BADCHAR);
+ need_par_end = false;
+ break;
+ case '(':
+ if (!quote && !dollar && !have_sq && !have_dq &&
+ !have_cmd)
+ return (WRDE_BADCHAR);
+ if (dollar) {
+ if (!quote && !have_sq)
+ need_cmd_new = true;
+ have_cmd = true;
+ }
+ break;
+ case ')':
+ if (!quote && !have_sq && !have_dq && !have_cmd)
+ return (WRDE_BADCHAR);
+ need_cmd_new = false;
+ break;
+ case '|': case '&': case ';': case '<': case '>': case '\n':
+ if (!quote && !have_sq && !have_dq && !have_cmd)
+ return (WRDE_BADCHAR);
break;
default:
break;
}
- quote = 0;
+ quote = dollar = false;
}
- if (quote + squote + dquote != 0)
+ if (quote || dollar || need_sq || need_dq || need_par_end ||
+ need_cmd_old || need_cmd_new)
return (WRDE_SYNTAX);
return (0);
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index 1f56bc2..eebce0a 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -68,11 +68,10 @@ static int s_scale;
void moncontrol(int);
static int hertz(void);
+void _mcleanup(void);
void
-monstartup(lowpc, highpc)
- u_long lowpc;
- u_long highpc;
+monstartup(u_long lowpc, u_long highpc)
{
int o;
char *cp;
@@ -218,8 +217,7 @@ _mcleanup(void)
* all the data structures are ready.
*/
void
-moncontrol(mode)
- int mode;
+moncontrol(int mode)
{
struct gmonparam *p = &_gmonparam;
@@ -239,7 +237,7 @@ moncontrol(mode)
* if something goes wrong, we return 0, an impossible hertz.
*/
static int
-hertz()
+hertz(void)
{
struct itimerval tim;
diff --git a/lib/libc/inet/inet_lnaof.c b/lib/libc/inet/inet_lnaof.c
index 7cab894..274253f 100644
--- a/lib/libc/inet/inet_lnaof.c
+++ b/lib/libc/inet/inet_lnaof.c
@@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$");
* number formats.
*/
in_addr_t
-inet_lnaof(in)
- struct in_addr in;
+inet_lnaof(struct in_addr in)
{
in_addr_t i = ntohl(in.s_addr);
diff --git a/lib/libc/inet/inet_makeaddr.c b/lib/libc/inet/inet_makeaddr.c
index 04a37a0..bce0aa1 100644
--- a/lib/libc/inet/inet_makeaddr.c
+++ b/lib/libc/inet/inet_makeaddr.c
@@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$");
* building addresses stored in the ifnet structure.
*/
struct in_addr
-inet_makeaddr(net, host)
- in_addr_t net, host;
+inet_makeaddr(in_addr_t net, in_addr_t host)
{
struct in_addr a;
diff --git a/lib/libc/inet/inet_net_ntop.c b/lib/libc/inet/inet_net_ntop.c
index da7af33..001a304 100644
--- a/lib/libc/inet/inet_net_ntop.c
+++ b/lib/libc/inet/inet_net_ntop.c
@@ -57,12 +57,7 @@ static char * inet_net_ntop_ipv6(const u_char *src, int bits, char *dst,
* Paul Vixie (ISC), July 1996
*/
char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
+inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size)
{
switch (af) {
case AF_INET:
@@ -89,11 +84,7 @@ inet_net_ntop(af, src, bits, dst, size)
* Paul Vixie (ISC), July 1996
*/
static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
+inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
{
char *odst = dst;
char *t;
diff --git a/lib/libc/inet/inet_neta.c b/lib/libc/inet/inet_neta.c
index 01ad3be..06a1bdb 100644
--- a/lib/libc/inet/inet_neta.c
+++ b/lib/libc/inet/inet_neta.c
@@ -52,10 +52,7 @@ __FBSDID("$FreeBSD$");
* Paul Vixie (ISC), July 1996
*/
char *
-inet_neta(src, dst, size)
- in_addr_t src;
- char *dst;
- size_t size;
+inet_neta(in_addr_t src, char *dst, size_t size)
{
char *odst = dst;
char *tp;
diff --git a/lib/libc/inet/inet_netof.c b/lib/libc/inet/inet_netof.c
index 8931c30..2335772 100644
--- a/lib/libc/inet/inet_netof.c
+++ b/lib/libc/inet/inet_netof.c
@@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$");
* address; handles class a/b/c network #'s.
*/
in_addr_t
-inet_netof(in)
- struct in_addr in;
+inet_netof(struct in_addr in)
{
in_addr_t i = ntohl(in.s_addr);
diff --git a/lib/libc/inet/inet_network.c b/lib/libc/inet/inet_network.c
index 254db41..b5b9190 100644
--- a/lib/libc/inet/inet_network.c
+++ b/lib/libc/inet/inet_network.c
@@ -48,8 +48,7 @@ __FBSDID("$FreeBSD$");
* network numbers.
*/
in_addr_t
-inet_network(cp)
- const char *cp;
+inet_network(const char *cp)
{
in_addr_t val, base, n;
char c;
diff --git a/lib/libc/isc/ev_timers.c b/lib/libc/isc/ev_timers.c
index 7c25c67..6d08e37 100644
--- a/lib/libc/isc/ev_timers.c
+++ b/lib/libc/isc/ev_timers.c
@@ -117,7 +117,7 @@ evCmpTime(struct timespec a, struct timespec b) {
}
struct timespec
-evNowTime() {
+evNowTime(void) {
struct timeval now;
#ifdef CLOCK_REALTIME
struct timespec tsnow;
@@ -136,7 +136,7 @@ evNowTime() {
}
struct timespec
-evUTCTime() {
+evUTCTime(void) {
struct timeval now;
#ifdef CLOCK_REALTIME
struct timespec tsnow;
diff --git a/lib/libc/locale/isctype.c b/lib/libc/locale/isctype.c
index be1b091..2550534 100644
--- a/lib/libc/locale/isctype.c
+++ b/lib/libc/locale/isctype.c
@@ -45,184 +45,161 @@ __FBSDID("$FreeBSD$");
#undef digittoint
int
-digittoint(c)
- int c;
+digittoint(int c)
{
return (__sbmaskrune(c, 0xFF));
}
#undef isalnum
int
-isalnum(c)
- int c;
+isalnum(int c)
{
return (__sbistype(c, _CTYPE_A|_CTYPE_D));
}
#undef isalpha
int
-isalpha(c)
- int c;
+isalpha(int c)
{
return (__sbistype(c, _CTYPE_A));
}
#undef isascii
int
-isascii(c)
- int c;
+isascii(int c)
{
return ((c & ~0x7F) == 0);
}
#undef isblank
int
-isblank(c)
- int c;
+isblank(int c)
{
return (__sbistype(c, _CTYPE_B));
}
#undef iscntrl
int
-iscntrl(c)
- int c;
+iscntrl(int c)
{
return (__sbistype(c, _CTYPE_C));
}
#undef isdigit
int
-isdigit(c)
- int c;
+isdigit(int c)
{
return (__isctype(c, _CTYPE_D));
}
#undef isgraph
int
-isgraph(c)
- int c;
+isgraph(int c)
{
return (__sbistype(c, _CTYPE_G));
}
#undef ishexnumber
int
-ishexnumber(c)
- int c;
+ishexnumber(int c)
{
return (__sbistype(c, _CTYPE_X));
}
#undef isideogram
int
-isideogram(c)
- int c;
+isideogram(int c)
{
return (__sbistype(c, _CTYPE_I));
}
#undef islower
int
-islower(c)
- int c;
+islower(int c)
{
return (__sbistype(c, _CTYPE_L));
}
#undef isnumber
int
-isnumber(c)
- int c;
+isnumber(int c)
{
return (__sbistype(c, _CTYPE_D));
}
#undef isphonogram
int
-isphonogram(c)
- int c;
+isphonogram(int c)
{
return (__sbistype(c, _CTYPE_Q));
}
#undef isprint
int
-isprint(c)
- int c;
+isprint(int c)
{
return (__sbistype(c, _CTYPE_R));
}
#undef ispunct
int
-ispunct(c)
- int c;
+ispunct(int c)
{
return (__sbistype(c, _CTYPE_P));
}
#undef isrune
int
-isrune(c)
- int c;
+isrune(int c)
{
return (__sbistype(c, 0xFFFFFF00L));
}
#undef isspace
int
-isspace(c)
- int c;
+isspace(int c)
{
return (__sbistype(c, _CTYPE_S));
}
#undef isspecial
int
-isspecial(c)
- int c;
+isspecial(int c)
{
return (__sbistype(c, _CTYPE_T));
}
#undef isupper
int
-isupper(c)
- int c;
+isupper(int c)
{
return (__sbistype(c, _CTYPE_U));
}
#undef isxdigit
int
-isxdigit(c)
- int c;
+isxdigit(int c)
{
return (__isctype(c, _CTYPE_X));
}
#undef toascii
int
-toascii(c)
- int c;
+toascii(int c)
{
return (c & 0x7F);
}
#undef tolower
int
-tolower(c)
- int c;
+tolower(int c)
{
return (__sbtolower(c));
}
#undef toupper
int
-toupper(c)
- int c;
+toupper(int c)
{
return (__sbtoupper(c));
}
diff --git a/lib/libc/locale/iswctype.c b/lib/libc/locale/iswctype.c
index eaa1bf3..59d432c 100644
--- a/lib/libc/locale/iswctype.c
+++ b/lib/libc/locale/iswctype.c
@@ -42,168 +42,147 @@ __FBSDID("$FreeBSD$");
#undef iswalnum
int
-iswalnum(wc)
- wint_t wc;
+iswalnum(wint_t wc)
{
return (__istype(wc, _CTYPE_A|_CTYPE_D));
}
#undef iswalpha
int
-iswalpha(wc)
- wint_t wc;
+iswalpha(wint_t wc)
{
return (__istype(wc, _CTYPE_A));
}
#undef iswascii
int
-iswascii(wc)
- wint_t wc;
+iswascii(wint_t wc)
{
return ((wc & ~0x7F) == 0);
}
#undef iswblank
int
-iswblank(wc)
- wint_t wc;
+iswblank(wint_t wc)
{
return (__istype(wc, _CTYPE_B));
}
#undef iswcntrl
int
-iswcntrl(wc)
- wint_t wc;
+iswcntrl(wint_t wc)
{
return (__istype(wc, _CTYPE_C));
}
#undef iswdigit
int
-iswdigit(wc)
- wint_t wc;
+iswdigit(wint_t wc)
{
return (__isctype(wc, _CTYPE_D));
}
#undef iswgraph
int
-iswgraph(wc)
- wint_t wc;
+iswgraph(wint_t wc)
{
return (__istype(wc, _CTYPE_G));
}
#undef iswhexnumber
int
-iswhexnumber(wc)
- wint_t wc;
+iswhexnumber(wint_t wc)
{
return (__istype(wc, _CTYPE_X));
}
#undef iswideogram
int
-iswideogram(wc)
- wint_t wc;
+iswideogram(wint_t wc)
{
return (__istype(wc, _CTYPE_I));
}
#undef iswlower
int
-iswlower(wc)
- wint_t wc;
+iswlower(wint_t wc)
{
return (__istype(wc, _CTYPE_L));
}
#undef iswnumber
int
-iswnumber(wc)
- wint_t wc;
+iswnumber(wint_t wc)
{
return (__istype(wc, _CTYPE_D));
}
#undef iswphonogram
int
-iswphonogram(wc)
- wint_t wc;
+iswphonogram(wint_t wc)
{
return (__istype(wc, _CTYPE_Q));
}
#undef iswprint
int
-iswprint(wc)
- wint_t wc;
+iswprint(wint_t wc)
{
return (__istype(wc, _CTYPE_R));
}
#undef iswpunct
int
-iswpunct(wc)
- wint_t wc;
+iswpunct(wint_t wc)
{
return (__istype(wc, _CTYPE_P));
}
#undef iswrune
int
-iswrune(wc)
- wint_t wc;
+iswrune(wint_t wc)
{
return (__istype(wc, 0xFFFFFF00L));
}
#undef iswspace
int
-iswspace(wc)
- wint_t wc;
+iswspace(wint_t wc)
{
return (__istype(wc, _CTYPE_S));
}
#undef iswspecial
int
-iswspecial(wc)
- wint_t wc;
+iswspecial(wint_t wc)
{
return (__istype(wc, _CTYPE_T));
}
#undef iswupper
int
-iswupper(wc)
- wint_t wc;
+iswupper(wint_t wc)
{
return (__istype(wc, _CTYPE_U));
}
#undef iswxdigit
int
-iswxdigit(wc)
- wint_t wc;
+iswxdigit(wint_t wc)
{
return (__isctype(wc, _CTYPE_X));
}
#undef towlower
wint_t
-towlower(wc)
- wint_t wc;
+towlower(wint_t wc)
{
return (__tolower(wc));
}
#undef towupper
wint_t
-towupper(wc)
- wint_t wc;
+towupper(wint_t wc)
{
return (__toupper(wc));
}
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 0322af2..13ff25b 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -98,9 +98,7 @@ static char *loadlocale(int);
const char *__get_locale_env(int);
char *
-setlocale(category, locale)
- int category;
- const char *locale;
+setlocale(int category, const char *locale)
{
int i, j, len, saverr;
const char *env, *r;
@@ -209,7 +207,7 @@ setlocale(category, locale)
}
static char *
-currentlocale()
+currentlocale(void)
{
int i;
@@ -228,8 +226,7 @@ currentlocale()
}
static char *
-loadlocale(category)
- int category;
+loadlocale(int category)
{
char *new = new_categories[category];
char *old = current_categories[category];
@@ -286,8 +283,7 @@ loadlocale(category)
}
const char *
-__get_locale_env(category)
- int category;
+__get_locale_env(int category)
{
const char *env;
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index f2eb483..c74791d 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
#include "mblocal.h"
__ct_rune_t
-___tolower_l(c, l)
- __ct_rune_t c;
- locale_t l;
+___tolower_l(__ct_rune_t c, locale_t l)
{
size_t lim;
FIX_LOCALE(l);
@@ -72,8 +70,7 @@ ___tolower_l(c, l)
return(c);
}
__ct_rune_t
-___tolower(c)
- __ct_rune_t c;
+___tolower(__ct_rune_t c)
{
return ___tolower_l(c, __get_locale());
}
diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c
index 704ac3a..2c5ec86 100644
--- a/lib/libc/locale/toupper.c
+++ b/lib/libc/locale/toupper.c
@@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
#include "mblocal.h"
__ct_rune_t
-___toupper_l(c, l)
- __ct_rune_t c;
- locale_t l;
+___toupper_l(__ct_rune_t c, locale_t l)
{
size_t lim;
FIX_LOCALE(l);
@@ -74,8 +72,7 @@ ___toupper_l(c, l)
return(c);
}
__ct_rune_t
-___toupper(c)
- __ct_rune_t c;
+___toupper(__ct_rune_t c)
{
return ___toupper_l(c, __get_locale());
}
diff --git a/lib/libc/mips/gen/_set_tp.c b/lib/libc/mips/gen/_set_tp.c
index 0bf04b52..a1a30c5 100644
--- a/lib/libc/mips/gen/_set_tp.c
+++ b/lib/libc/mips/gen/_set_tp.c
@@ -30,6 +30,7 @@
#include <stdint.h>
#include <machine/sysarch.h>
+#include "libc_private.h"
void
_set_tp(void *tp)
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3
index 570fc2e..e13c667 100644
--- a/lib/libc/net/getaddrinfo.3
+++ b/lib/libc/net/getaddrinfo.3
@@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 14, 2013
+.Dd September 20, 2015
.Dt GETADDRINFO 3
.Os
.Sh NAME
@@ -40,7 +40,6 @@
The
.Fn getaddrinfo
function is used to get a list of
-.Tn IP
addresses and port numbers for host
.Fa hostname
and service
@@ -59,7 +58,9 @@ arguments are either pointers to NUL-terminated strings or the null pointer.
An acceptable value for
.Fa hostname
is either a valid host name or a numeric host address string consisting
-of a dotted decimal IPv4 address or an IPv6 address.
+of a dotted decimal IPv4 address,
+an IPv6 address,
+or a UNIX-domain address.
The
.Fa servname
is either a decimal port number or a service name listed in
@@ -105,6 +106,7 @@ operating system.
Denotes the type of socket that is wanted:
.Dv SOCK_STREAM ,
.Dv SOCK_DGRAM ,
+.Dv SOCK_SEQPACKET ,
or
.Dv SOCK_RAW .
When
@@ -112,9 +114,11 @@ When
is zero the caller will accept any socket type.
.It Fa ai_protocol
Indicates which transport protocol is desired,
-.Dv IPPROTO_UDP
+.Dv IPPROTO_UDP ,
+.Dv IPPROTO_TCP ,
+.Dv IPPROTO_SCTP ,
or
-.Dv IPPROTO_TCP .
+.Dv IPPROTO_UDPLITE .
If
.Fa ai_protocol
is zero the caller will accept any protocol.
@@ -131,6 +135,9 @@ or be the bitwise-inclusive OR of one or more of the values
.Dv AI_NUMERICSERV
and
.Dv AI_PASSIVE .
+For a UNIX-domain address,
+.Fa ai_flags
+is ignored.
.Bl -tag -width "AI_CANONNAMEXX"
.It Dv AI_ADDRCONFIG
If the
@@ -419,6 +426,9 @@ freeaddrinfo(res0);
.Xr getnameinfo 3 ,
.Xr getservbyname 3 ,
.Xr resolver 3 ,
+.Xr inet 4 ,
+.Xr inet6 4 ,
+.Xr unix 4 ,
.Xr hosts 5 ,
.Xr resolv.conf 5 ,
.Xr services 5 ,
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 17c9b65..8b47aef 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -137,13 +137,20 @@ static const struct afd {
offsetof(struct sockaddr_in6, sin6_addr),
in6_addrany, in6_loopback, 1},
#define N_INET 1
+#define N_LOCAL 2
#else
#define N_INET 0
+#define N_LOCAL 1
#endif
{PF_INET, sizeof(struct in_addr),
sizeof(struct sockaddr_in),
offsetof(struct sockaddr_in, sin_addr),
in_addrany, in_loopback, 0},
+#define sizeofmember(type, member) (sizeof(((type *)0)->member))
+ {PF_LOCAL, sizeofmember(struct sockaddr_un, sun_path),
+ sizeof(struct sockaddr_un),
+ offsetof(struct sockaddr_un, sun_path),
+ NULL, NULL, 0},
{0, 0, 0, 0, NULL, NULL, 0},
};
@@ -152,29 +159,47 @@ struct explore {
int e_socktype;
int e_protocol;
int e_wild;
-#define WILD_AF(ex) ((ex)->e_wild & 0x01)
-#define WILD_SOCKTYPE(ex) ((ex)->e_wild & 0x02)
-#define WILD_PROTOCOL(ex) ((ex)->e_wild & 0x04)
+#define AF_ANY 0x01
+#define SOCKTYPE_ANY 0x02
+#define PROTOCOL_ANY 0x04
+#define WILD_AF(ex) ((ex)->e_wild & AF_ANY)
+#define WILD_SOCKTYPE(ex) ((ex)->e_wild & SOCKTYPE_ANY)
+#define WILD_PROTOCOL(ex) ((ex)->e_wild & PROTOCOL_ANY)
};
static const struct explore explore[] = {
-#if 0
- { PF_LOCAL, ANY, ANY, 0x01 },
-#endif
+ { PF_LOCAL, SOCK_DGRAM, ANY,
+ AF_ANY | PROTOCOL_ANY },
+ { PF_LOCAL, SOCK_STREAM, ANY,
+ AF_ANY | PROTOCOL_ANY },
+ { PF_LOCAL, SOCK_SEQPACKET, ANY,
+ AF_ANY | PROTOCOL_ANY },
#ifdef INET6
- { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, 0x07 },
- { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 },
- { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 },
- { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 },
- { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 },
- { PF_INET6, SOCK_RAW, ANY, 0x05 },
+ { PF_INET6, SOCK_DGRAM, IPPROTO_UDP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET6, SOCK_STREAM, IPPROTO_TCP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET6, SOCK_STREAM, IPPROTO_SCTP,
+ AF_ANY | SOCKTYPE_ANY },
+ { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE,
+ AF_ANY | SOCKTYPE_ANY },
+ { PF_INET6, SOCK_RAW, ANY,
+ AF_ANY | PROTOCOL_ANY },
#endif
- { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 },
- { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 },
- { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 },
- { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 },
- { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 },
- { PF_INET, SOCK_RAW, ANY, 0x05 },
+ { PF_INET, SOCK_DGRAM, IPPROTO_UDP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET, SOCK_STREAM, IPPROTO_TCP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET, SOCK_STREAM, IPPROTO_SCTP,
+ AF_ANY | SOCKTYPE_ANY },
+ { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP,
+ AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
+ { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE,
+ AF_ANY | SOCKTYPE_ANY },
+ { PF_INET, SOCK_RAW, ANY,
+ AF_ANY | PROTOCOL_ANY },
{ -1, 0, 0, 0 },
};
@@ -408,6 +433,7 @@ getaddrinfo(const char *hostname, const char *servname,
ERR(EAI_BADFLAGS);
switch (hints->ai_family) {
case PF_UNSPEC:
+ case PF_LOCAL:
case PF_INET:
#ifdef INET6
case PF_INET6:
@@ -1130,6 +1156,9 @@ explore_null(const struct addrinfo *pai, const char *servname,
*res = NULL;
ai = NULL;
+ if (pai->ai_family == PF_LOCAL)
+ return (0);
+
/*
* filter out AFs that are not supported by the kernel
* XXX errno?
@@ -1172,8 +1201,11 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
const struct afd *afd;
struct addrinfo *ai;
int error;
- char pton[PTON_MAX];
+ char pton[PTON_MAX], path[PATH_MAX], *p;
+#ifdef CTASSERT
+ CTASSERT(sizeofmember(struct sockaddr_un, sun_path) <= PATH_MAX);
+#endif
*res = NULL;
ai = NULL;
@@ -1182,6 +1214,15 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
return 0;
switch (afd->a_af) {
+ case AF_LOCAL:
+ if (hostname[0] != '/')
+ ERR(EAI_NONAME);
+ if (strlen(hostname) > afd->a_addrlen)
+ ERR(EAI_MEMORY);
+ /* NUL-termination does not need to be guaranteed. */
+ strncpy(path, hostname, afd->a_addrlen);
+ p = &path[0];
+ break;
case AF_INET:
/*
* RFC3493 requires getaddrinfo() to accept AF_INET formats
@@ -1192,15 +1233,17 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
*/
if (inet_aton(hostname, (struct in_addr *)pton) != 1)
return 0;
+ p = pton;
break;
default:
if (inet_pton(afd->a_af, hostname, pton) != 1)
return 0;
+ p = pton;
break;
}
if (pai->ai_family == afd->a_af) {
- GET_AI(ai, afd, pton);
+ GET_AI(ai, afd, p);
GET_PORT(ai, servname);
if ((pai->ai_flags & AI_CANONNAME)) {
/*
@@ -1320,6 +1363,12 @@ get_ai(const struct addrinfo *pai, const struct afd *afd, const char *addr)
memset(ai->ai_addr, 0, (size_t)afd->a_socklen);
ai->ai_addr->sa_len = afd->a_socklen;
ai->ai_addrlen = afd->a_socklen;
+ if (ai->ai_family == PF_LOCAL) {
+ size_t n = strnlen(addr, afd->a_addrlen);
+
+ ai->ai_addrlen -= afd->a_addrlen - n;
+ ai->ai_addr->sa_len -= afd->a_addrlen - n;
+ }
ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
p = (char *)(void *)(ai->ai_addr);
memcpy(p + afd->a_off, addr, (size_t)afd->a_addrlen);
@@ -1378,6 +1427,9 @@ get_port(struct addrinfo *ai, const char *servname, int matchonly)
if (servname == NULL)
return 0;
switch (ai->ai_family) {
+ case AF_LOCAL:
+ /* AF_LOCAL ignores servname silently. */
+ return (0);
case AF_INET:
#ifdef AF_INET6
case AF_INET6:
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index f301c88..ac93abe 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -107,10 +107,7 @@ int _dns_ttl_;
#ifdef DEBUG
static void
-dprintf(msg, num, res)
- char *msg;
- int num;
- res_state res;
+dprintf(char *msg, int num, res_state res)
{
if (res->options & RES_DEBUG) {
int save = errno;
@@ -769,7 +766,7 @@ _sethostdnsent(int stayopen)
}
void
-_endhostdnsent()
+_endhostdnsent(void)
{
res_state statp;
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 2dc9d02..6bbe270 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -48,13 +48,6 @@ __FBSDID("$FreeBSD$");
#include "nscache.h"
#endif
-extern int _ht_gethostbyname(void *, void *, va_list);
-extern int _dns_gethostbyname(void *, void *, va_list);
-extern int _nis_gethostbyname(void *, void *, va_list);
-extern int _ht_gethostbyaddr(void *, void *, va_list);
-extern int _dns_gethostbyaddr(void *, void *, va_list);
-extern int _nis_gethostbyaddr(void *, void *, va_list);
-
static int gethostbyname_internal(const char *, int, struct hostent *, char *,
size_t, struct hostent **, int *, res_state);
diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3
index 0549ccd..ff227fd 100644
--- a/lib/libc/net/getnameinfo.3
+++ b/lib/libc/net/getnameinfo.3
@@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 14, 2013
+.Dd September 20, 2015
.Dt GETNAMEINFO 3
.Os
.Sh NAME
@@ -47,7 +47,7 @@ functions and is the converse of the
.Xr getaddrinfo 3
function.
.Pp
-If a link-layer address is passed to
+If a link-layer address or UNIX-domain address is passed to
.Fn getnameinfo ,
its ASCII representation will be stored in
.Fa host .
@@ -56,7 +56,8 @@ The string pointed to by
will be set to the empty string if non-NULL;
.Fa flags
will always be ignored.
-This is intended as a replacement for the legacy
+For a link-layer address,
+this can be used as a replacement of the legacy
.Xr link_ntoa 3
function.
.Pp
@@ -66,10 +67,17 @@ structure
.Fa sa
should point to either a
.Li sockaddr_in ,
-.Li sockaddr_in6
+.Li sockaddr_in6 ,
+.Li sockaddr_dl ,
or
-.Li sockaddr_dl
-structure (for IPv4, IPv6 or link-layer respectively) that is
+.Li sockaddr_un
+structure
+.Po for IPv4 ,
+IPv6,
+link-layer,
+or UNIX-domain respectively
+.Pc
+that is
.Fa salen
bytes long.
.Pp
@@ -182,6 +190,9 @@ printf("host=%s\en", hbuf);
.Xr inet_ntop 3 ,
.Xr link_ntoa 3 ,
.Xr resolver 3 ,
+.Xr inet 4 ,
+.Xr inet6 4 ,
+.Xr unix 4 ,
.Xr hosts 5 ,
.Xr resolv.conf 5 ,
.Xr services 5 ,
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index d7e7971..c813189 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/un.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
@@ -62,67 +63,102 @@ __FBSDID("$FreeBSD$");
#include <stddef.h>
#include <errno.h>
-static int getnameinfo_inet(const struct sockaddr *, socklen_t, char *,
+static const struct afd *find_afd(int);
+static int getnameinfo_inet(const struct afd *,
+ const struct sockaddr *, socklen_t, char *,
size_t, char *, size_t, int);
#ifdef INET6
static int ip6_parsenumeric(const struct sockaddr *, const char *, char *,
size_t, int);
static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int);
#endif
-static int getnameinfo_link(const struct sockaddr *, socklen_t, char *,
+static int getnameinfo_link(const struct afd *,
+ const struct sockaddr *, socklen_t, char *,
+ size_t, char *, size_t, int);
+static int hexname(const u_int8_t *, size_t, char *, size_t);
+static int getnameinfo_un(const struct afd *,
+ const struct sockaddr *, socklen_t, char *,
size_t, char *, size_t, int);
-static int hexname(const u_int8_t *, size_t, char *, size_t);
-
-int
-getnameinfo(const struct sockaddr *sa, socklen_t salen,
- char *host, size_t hostlen, char *serv, size_t servlen,
- int flags)
-{
- if (sa == NULL)
- return (EAI_FAIL);
-
- switch (sa->sa_family) {
- case AF_INET:
-#ifdef INET6
- case AF_INET6:
-#endif
- return getnameinfo_inet(sa, salen, host, hostlen, serv,
- servlen, flags);
- case AF_LINK:
- return getnameinfo_link(sa, salen, host, hostlen, serv,
- servlen, flags);
- default:
- return EAI_FAMILY;
- }
-}
static const struct afd {
int a_af;
size_t a_addrlen;
socklen_t a_socklen;
int a_off;
+ int (*a_func)(const struct afd *,
+ const struct sockaddr *, socklen_t, char *,
+ size_t, char *, size_t, int);
} afdl [] = {
#ifdef INET6
{PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
- offsetof(struct sockaddr_in6, sin6_addr)},
+ offsetof(struct sockaddr_in6, sin6_addr),
+ getnameinfo_inet},
#endif
{PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in),
- offsetof(struct sockaddr_in, sin_addr)},
+ offsetof(struct sockaddr_in, sin_addr),
+ getnameinfo_inet},
+#define sizeofmember(type, member) (sizeof(((type *)0)->member))
+ {PF_LOCAL, sizeofmember(struct sockaddr_un, sun_path),
+ sizeof(struct sockaddr_un),
+ offsetof(struct sockaddr_un, sun_path),
+ getnameinfo_un},
+ {PF_LINK, sizeofmember(struct sockaddr_dl, sdl_data),
+ sizeof(struct sockaddr_dl),
+ offsetof(struct sockaddr_dl, sdl_data),
+ getnameinfo_link},
{0, 0, 0},
};
-struct sockinet {
- u_char si_len;
- u_char si_family;
- u_short si_port;
-};
+int
+getnameinfo(const struct sockaddr *sa, socklen_t salen,
+ char *host, size_t hostlen, char *serv, size_t servlen,
+ int flags)
+{
+ const struct afd *afd;
+
+ if (sa == NULL)
+ return (EAI_FAIL);
+
+ afd = find_afd(sa->sa_family);
+ if (afd == NULL)
+ return (EAI_FAMILY);
+ if (sa->sa_family == PF_LOCAL) {
+ /*
+ * PF_LOCAL uses variable sa->sa_len depending on the
+ * content length of sun_path. Require 1 byte in
+ * sun_path at least.
+ */
+ if (salen > afd->a_socklen ||
+ salen <= afd->a_socklen -
+ sizeofmember(struct sockaddr_un, sun_path))
+ return (EAI_FAIL);
+ } else if (salen != afd->a_socklen)
+ return (EAI_FAIL);
+
+ return ((*afd->a_func)(afd, sa, salen, host, hostlen,
+ serv, servlen, flags));
+}
+
+static const struct afd *
+find_afd(int af)
+{
+ const struct afd *afd;
+
+ if (af == PF_UNSPEC)
+ return (NULL);
+ for (afd = &afdl[0]; afd->a_af > 0; afd++) {
+ if (afd->a_af == af)
+ return (afd);
+ }
+ return (NULL);
+}
static int
-getnameinfo_inet(const struct sockaddr *sa, socklen_t salen,
+getnameinfo_inet(const struct afd *afd,
+ const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen, char *serv, size_t servlen,
int flags)
{
- const struct afd *afd;
struct servent *sp;
struct hostent *hp;
u_short port;
@@ -132,18 +168,8 @@ getnameinfo_inet(const struct sockaddr *sa, socklen_t salen,
char numserv[512];
char numaddr[512];
- for (afd = &afdl[0]; afd->a_af > 0; afd++) {
- if (afd->a_af == sa->sa_family)
- break;
- }
- if (afd->a_af == 0)
- return (EAI_FAMILY);
-
- if (salen != afd->a_socklen)
- return EAI_FAIL;
-
/* network byte order */
- port = ((const struct sockinet *)sa)->si_port;
+ port = ((const struct sockaddr_in *)sa)->sin_port;
addr = (const char *)sa + afd->a_off;
if (serv == NULL || servlen == 0) {
@@ -377,7 +403,8 @@ ip6_sa2str(const struct sockaddr_in6 *sa6, char *buf, size_t bufsiz, int flags)
*/
/* ARGSUSED */
static int
-getnameinfo_link(const struct sockaddr *sa, socklen_t salen,
+getnameinfo_link(const struct afd *afd,
+ const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen, char *serv, size_t servlen, int flags)
{
const struct sockaddr_dl *sdl =
@@ -465,3 +492,30 @@ hexname(const u_int8_t *cp, size_t len, char *host, size_t hostlen)
}
return 0;
}
+
+/*
+ * getnameinfo_un():
+ * Format a UNIX IPC domain address (pathname).
+ */
+/* ARGSUSED */
+static int
+getnameinfo_un(const struct afd *afd,
+ const struct sockaddr *sa, socklen_t salen,
+ char *host, size_t hostlen, char *serv, size_t servlen, int flags)
+{
+ size_t pathlen;
+
+ if (serv != NULL && servlen > 0)
+ *serv = '\0';
+ if (host != NULL && hostlen > 0) {
+ pathlen = sa->sa_len - afd->a_off;
+
+ if (pathlen + 1 > hostlen) {
+ *host = '\0';
+ return (EAI_MEMORY);
+ }
+ strlcpy(host, (const char *)sa + afd->a_off, pathlen + 1);
+ }
+
+ return (0);
+}
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c
index 79e40a5..6667a82 100644
--- a/lib/libc/net/getnetbydns.c
+++ b/lib/libc/net/getnetbydns.c
@@ -455,7 +455,7 @@ _setnetdnsent(int stayopen)
}
void
-_endnetdnsent()
+_endnetdnsent(void)
{
res_state statp;
diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c
index 9aa4d51..4d2fb38 100644
--- a/lib/libc/net/getnetnamadr.c
+++ b/lib/libc/net/getnetnamadr.c
@@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$");
#include "nscache.h"
#endif
-extern int _ht_getnetbyname(void *, void *, va_list);
-extern int _dns_getnetbyname(void *, void *, va_list);
-extern int _nis_getnetbyname(void *, void *, va_list);
-extern int _ht_getnetbyaddr(void *, void *, va_list);
-extern int _dns_getnetbyaddr(void *, void *, va_list);
-extern int _nis_getnetbyaddr(void *, void *, va_list);
-
/* Network lookup order if nsswitch.conf is broken or nonexistant */
static const ns_src default_src[] = {
{ NSSRC_FILES, NS_SUCCESS },
diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c
index b923edf..36eeb90 100644
--- a/lib/libc/net/getproto.c
+++ b/lib/libc/net/getproto.c
@@ -47,12 +47,6 @@ static const ns_src defaultsrc[] = {
{ NULL, 0 }
};
-#ifdef NS_CACHING
-extern int __proto_id_func(char *, size_t *, va_list, void *);
-extern int __proto_marshal_func(char *, size_t *, void *, va_list, void *);
-extern int __proto_unmarshal_func(char *, size_t, void *, va_list, void *);
-#endif
-
static int
files_getprotobynumber(void *retval, void *mdata, va_list ap)
{
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 005de98..6a68ef5 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -1241,7 +1241,7 @@ setservent(int stayopen)
}
void
-endservent()
+endservent(void)
{
#ifdef NS_CACHING
static const nss_cache_info cache_info = NS_MP_CACHE_INFO_INITIALIZER(
@@ -1362,7 +1362,7 @@ getservbyport(int port, const char *proto)
}
struct servent *
-getservent()
+getservent(void)
{
struct key key;
diff --git a/lib/libc/net/linkaddr.c b/lib/libc/net/linkaddr.c
index 5be6e74..2f7222b 100644
--- a/lib/libc/net/linkaddr.c
+++ b/lib/libc/net/linkaddr.c
@@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$");
#define LETTER (4*3)
void
-link_addr(addr, sdl)
- const char *addr;
- struct sockaddr_dl *sdl;
+link_addr(const char *addr, struct sockaddr_dl *sdl)
{
char *cp = sdl->sdl_data;
char *cplim = sdl->sdl_len + (char *)sdl;
@@ -121,8 +119,7 @@ link_addr(addr, sdl)
static const char hexlist[] = "0123456789abcdef";
char *
-link_ntoa(sdl)
- const struct sockaddr_dl *sdl;
+link_ntoa(const struct sockaddr_dl *sdl)
{
static char obuf[64];
char *out = obuf;
diff --git a/lib/libc/net/map_v4v6.c b/lib/libc/net/map_v4v6.c
index dbc7e70..09b035b 100644
--- a/lib/libc/net/map_v4v6.c
+++ b/lib/libc/net/map_v4v6.c
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
#include <resolv.h>
#include <ctype.h>
#include <syslog.h>
+#include "netdb_private.h"
typedef union {
int32_t al;
diff --git a/lib/libc/net/netdb_private.h b/lib/libc/net/netdb_private.h
index b48dd7b..0eedb3c 100644
--- a/lib/libc/net/netdb_private.h
+++ b/lib/libc/net/netdb_private.h
@@ -142,4 +142,23 @@ void _sethosthtent(int, struct hostent_data *);
void _setnetdnsent(int);
void _setnethtent(int, struct netent_data *);
+struct hostent *__dns_getanswer(const char *, int, const char *, int);
+int _dns_gethostbyaddr(void *, void *, va_list);
+int _dns_gethostbyname(void *, void *, va_list);
+int _dns_getnetbyaddr(void *, void *, va_list);
+int _dns_getnetbyname(void *, void *, va_list);
+int _ht_gethostbyaddr(void *, void *, va_list);
+int _ht_gethostbyname(void *, void *, va_list);
+int _ht_getnetbyaddr(void *, void *, va_list);
+int _ht_getnetbyname(void *, void *, va_list);
+int _nis_gethostbyaddr(void *, void *, va_list);
+int _nis_gethostbyname(void *, void *, va_list);
+int _nis_getnetbyaddr(void *, void *, va_list);
+int _nis_getnetbyname(void *, void *, va_list);
+#ifdef NS_CACHING
+int __proto_id_func(char *, size_t *, va_list, void *);
+int __proto_marshal_func(char *, size_t *, void *, va_list, void *);
+int __proto_unmarshal_func(char *, size_t, void *, va_list, void *);
+#endif
+
#endif /* _NETDB_PRIVATE_H_ */
diff --git a/lib/libc/net/nscache.c b/lib/libc/net/nscache.c
index 68cec21..88a115b 100644
--- a/lib/libc/net/nscache.c
+++ b/lib/libc/net/nscache.c
@@ -29,6 +29,7 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
+#define _NS_PRIVATE
#include <nsswitch.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/libc/net/nslexer.l b/lib/libc/net/nslexer.l
index 3983fa2..c7a95f6 100644
--- a/lib/libc/net/nslexer.l
+++ b/lib/libc/net/nslexer.l
@@ -97,14 +97,13 @@ STRING [a-zA-Z][a-zA-Z0-9_]*
#undef _nsyywrap
int
-_nsyywrap()
+_nsyywrap(void)
{
return 1;
} /* _nsyywrap */
void
-_nsyyerror(msg)
- const char *msg;
+_nsyyerror(const char *msg)
{
syslog(LOG_ERR, "NSSWITCH(nslexer): %s line %d: %s at '%s'",
diff --git a/lib/libc/net/nsparser.y b/lib/libc/net/nsparser.y
index c1d8424..7d2f6e2 100644
--- a/lib/libc/net/nsparser.y
+++ b/lib/libc/net/nsparser.y
@@ -145,8 +145,7 @@ Action
%%
static void
-_nsaddsrctomap(elem)
- const char *elem;
+_nsaddsrctomap(const char *elem)
{
int i, lineno;
extern int _nsyylineno;
diff --git a/lib/libc/net/nss_compat.c b/lib/libc/net/nss_compat.c
index 09a2d4f..ba1e951 100644
--- a/lib/libc/net/nss_compat.c
+++ b/lib/libc/net/nss_compat.c
@@ -79,6 +79,16 @@ do { \
DECLARE_TERMINATOR(group);
+int __nss_compat_getgrnam_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_getgrgid_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_getgrent_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_setgrent(void *retval, void *mdata, va_list ap);
+int __nss_compat_endgrent(void *retval, void *mdata, va_list ap);
+int __nss_compat_getpwnam_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_getpwuid_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_getpwent_r(void *retval, void *mdata, va_list ap);
+int __nss_compat_setpwent(void *retval, void *mdata, va_list ap);
+int __nss_compat_endpwent(void *retval, void *mdata, va_list ap);
int
__nss_compat_getgrnam_r(void *retval, void *mdata, va_list ap)
diff --git a/lib/libc/net/ntoh.c b/lib/libc/net/ntoh.c
index 738d8c7..d658c90 100644
--- a/lib/libc/net/ntoh.c
+++ b/lib/libc/net/ntoh.c
@@ -28,6 +28,8 @@
__FBSDID("$FreeBSD$");
#include <sys/endian.h>
+#define _BYTEORDER_FUNC_DEFINED
+#include <arpa/inet.h>
uint32_t
htonl(uint32_t hl)
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 1ba9888..c7ca870 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -73,22 +73,15 @@ static int __icheckhost(const struct sockaddr *, socklen_t, const char *);
char paddr[NI_MAXHOST];
int
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
+rcmd(char **ahost, int rport, const char *locuser, const char *remuser,
+ const char *cmd, int *fd2p)
{
return rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, AF_INET);
}
int
-rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
- char **ahost;
- u_short rport;
- const char *locuser, *remuser, *cmd;
- int *fd2p;
- int af;
+rcmd_af(char **ahost, int rport, const char *locuser, const char *remuser,
+ const char *cmd, int *fd2p, int af)
{
struct addrinfo hints, *res, *ai;
struct sockaddr_storage from;
@@ -321,15 +314,13 @@ bad:
}
int
-rresvport(port)
- int *port;
+rresvport(int *port)
{
return rresvport_af(port, AF_INET);
}
int
-rresvport_af(alport, family)
- int *alport, family;
+rresvport_af(int *alport, int family)
{
int s;
struct sockaddr_storage ss;
@@ -380,9 +371,7 @@ int __check_rhosts_file = 1;
char *__rcmd_errstr;
int
-ruserok(rhost, superuser, ruser, luser)
- const char *rhost, *ruser, *luser;
- int superuser;
+ruserok(const char *rhost, int superuser, const char *ruser, const char *luser)
{
struct addrinfo hints, *res, *r;
int error;
@@ -415,10 +404,7 @@ ruserok(rhost, superuser, ruser, luser)
* Returns 0 if ok, -1 if not ok.
*/
int
-iruserok(raddr, superuser, ruser, luser)
- unsigned long raddr;
- int superuser;
- const char *ruser, *luser;
+iruserok(unsigned long raddr, int superuser, const char *ruser, const char *luser)
{
struct sockaddr_in sin;
@@ -436,11 +422,8 @@ iruserok(raddr, superuser, ruser, luser)
* Returns 0 if ok, -1 if not ok.
*/
int
-iruserok_sa(ra, rlen, superuser, ruser, luser)
- const void *ra;
- int rlen;
- int superuser;
- const char *ruser, *luser;
+iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser,
+ const char *luser)
{
char *cp;
struct stat sbuf;
@@ -520,10 +503,7 @@ again:
* Returns 0 if ok, -1 if not ok.
*/
int
-__ivaliduser(hostf, raddr, luser, ruser)
- FILE *hostf;
- u_int32_t raddr;
- const char *luser, *ruser;
+__ivaliduser(FILE *hostf, u_int32_t raddr, const char *luser, const char *ruser)
{
struct sockaddr_in sin;
@@ -541,11 +521,8 @@ __ivaliduser(hostf, raddr, luser, ruser)
* XXX obsolete API.
*/
int
-__ivaliduser_af(hostf, raddr, luser, ruser, af, len)
- FILE *hostf;
- const void *raddr;
- const char *luser, *ruser;
- int af, len;
+__ivaliduser_af(FILE *hostf, const void *raddr, const char *luser,
+ const char *ruser, int af, int len)
{
struct sockaddr *sa = NULL;
struct sockaddr_in *sin = NULL;
@@ -584,11 +561,8 @@ __ivaliduser_af(hostf, raddr, luser, ruser, af, len)
}
int
-__ivaliduser_sa(hostf, raddr, salen, luser, ruser)
- FILE *hostf;
- const struct sockaddr *raddr;
- socklen_t salen;
- const char *luser, *ruser;
+__ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, socklen_t salen,
+ const char *luser, const char *ruser)
{
char *user, *p;
int ch;
@@ -707,10 +681,7 @@ __ivaliduser_sa(hostf, raddr, salen, luser, ruser)
* Returns "true" if match, 0 if no match.
*/
static int
-__icheckhost(raddr, salen, lhost)
- const struct sockaddr *raddr;
- socklen_t salen;
- const char *lhost;
+__icheckhost(const struct sockaddr *raddr, socklen_t salen, const char *lhost)
{
struct sockaddr_in sin;
struct sockaddr_in6 *sin6;
diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c
index 6a584ca..68d3ce5 100644
--- a/lib/libc/net/recv.c
+++ b/lib/libc/net/recv.c
@@ -40,10 +40,7 @@ __FBSDID("$FreeBSD$");
#include <stddef.h>
ssize_t
-recv(s, buf, len, flags)
- int s, flags;
- size_t len;
- void *buf;
+recv(int s, void *buf, size_t len, int flags)
{
/*
* POSIX says recv() shall be a cancellation point, so call the
diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c
index f92fdec..3b2ebba 100644
--- a/lib/libc/net/rthdr.c
+++ b/lib/libc/net/rthdr.c
@@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$");
*/
size_t
-inet6_rthdr_space(type, seg)
- int type, seg;
+inet6_rthdr_space(int type, int seg)
{
switch (type) {
case IPV6_RTHDR_TYPE_0:
@@ -67,9 +66,7 @@ inet6_rthdr_space(type, seg)
}
struct cmsghdr *
-inet6_rthdr_init(bp, type)
- void *bp;
- int type;
+inet6_rthdr_init(void *bp, int type)
{
struct cmsghdr *ch = (struct cmsghdr *)bp;
struct ip6_rthdr *rthdr;
@@ -98,10 +95,7 @@ inet6_rthdr_init(bp, type)
/* ARGSUSED */
int
-inet6_rthdr_add(cmsg, addr, flags)
- struct cmsghdr *cmsg;
- const struct in6_addr *addr;
- u_int flags;
+inet6_rthdr_add(struct cmsghdr *cmsg, const struct in6_addr *addr, u_int flags)
{
struct ip6_rthdr *rthdr;
@@ -143,9 +137,7 @@ inet6_rthdr_add(cmsg, addr, flags)
/* ARGSUSED */
int
-inet6_rthdr_lasthop(cmsg, flags)
- struct cmsghdr *cmsg;
- unsigned int flags;
+inet6_rthdr_lasthop(struct cmsghdr *cmsg, unsigned int flags)
{
struct ip6_rthdr *rthdr;
@@ -183,9 +175,7 @@ inet6_rthdr_lasthop(cmsg, flags)
#if 0
int
-inet6_rthdr_reverse(in, out)
- const struct cmsghdr *in;
- struct cmsghdr *out;
+inet6_rthdr_reverse(const struct cmsghdr *in, struct cmsghdr *out)
{
return (-1);
@@ -193,8 +183,7 @@ inet6_rthdr_reverse(in, out)
#endif
int
-inet6_rthdr_segments(cmsg)
- const struct cmsghdr *cmsg;
+inet6_rthdr_segments(const struct cmsghdr *cmsg)
{
struct ip6_rthdr *rthdr;
@@ -217,9 +206,7 @@ inet6_rthdr_segments(cmsg)
}
struct in6_addr *
-inet6_rthdr_getaddr(cmsg, idx)
- struct cmsghdr *cmsg;
- int idx;
+inet6_rthdr_getaddr(struct cmsghdr *cmsg, int idx)
{
struct ip6_rthdr *rthdr;
@@ -249,9 +236,7 @@ inet6_rthdr_getaddr(cmsg, idx)
}
int
-inet6_rthdr_getflags(cmsg, idx)
- const struct cmsghdr *cmsg;
- int idx;
+inet6_rthdr_getflags(const struct cmsghdr *cmsg, int idx)
{
struct ip6_rthdr *rthdr;
diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c
index c44f4b9..ff98436 100644
--- a/lib/libc/net/send.c
+++ b/lib/libc/net/send.c
@@ -40,10 +40,7 @@ __FBSDID("$FreeBSD$");
#include <stddef.h>
ssize_t
-send(s, msg, len, flags)
- int s, flags;
- size_t len;
- const void *msg;
+send(int s, const void *msg, size_t len, int flags)
{
/*
* POSIX says send() shall be a cancellation point, so call the
diff --git a/lib/libc/net/sockatmark.c b/lib/libc/net/sockatmark.c
index e416de8..9337da5 100644
--- a/lib/libc/net/sockatmark.c
+++ b/lib/libc/net/sockatmark.c
@@ -24,13 +24,16 @@
*
* $FreeBSD$
*/
+#include "namespace.h"
#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include "un-namespace.h"
int sockatmark(int s)
{
int atmark;
- if (ioctl(s, SIOCATMARK, &atmark) == -1)
+ if (_ioctl(s, SIOCATMARK, &atmark) == -1)
return -1;
return atmark;
}
diff --git a/lib/libc/posix1e/acl_compat.c b/lib/libc/posix1e/acl_compat.c
index c433920..ab1bdf6 100644
--- a/lib/libc/posix1e/acl_compat.c
+++ b/lib/libc/posix1e/acl_compat.c
@@ -29,6 +29,10 @@ __FBSDID("$FreeBSD$");
#include <sys/acl.h>
+int __oldacl_get_perm_np(acl_permset_t, oldacl_perm_t);
+int __oldacl_add_perm(acl_permset_t, oldacl_perm_t);
+int __oldacl_delete_perm(acl_permset_t, oldacl_perm_t);
+
/*
* Compatibility wrappers for applications compiled against libc from before
* NFSv4 ACLs were added.
diff --git a/lib/libc/posix1e/acl_support.h b/lib/libc/posix1e/acl_support.h
index 11fa29b..e7f35d5 100644
--- a/lib/libc/posix1e/acl_support.h
+++ b/lib/libc/posix1e/acl_support.h
@@ -45,6 +45,8 @@ int _acl_brand_may_be(const acl_t acl, int brand);
int _entry_brand_may_be(const acl_entry_t entry, int brand);
void _acl_brand_as(acl_t acl, int brand);
void _entry_brand_as(const acl_entry_t entry, int brand);
+int _nfs4_acl_entry_from_text(acl_t, char *);
+char *_nfs4_acl_to_text_np(const acl_t, ssize_t *, int);
int _nfs4_format_flags(char *str, size_t size, acl_flag_t var, int verbose);
int _nfs4_format_access_mask(char *str, size_t size, acl_perm_t var, int verbose);
int _nfs4_parse_flags(const char *str, acl_flag_t *var);
diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/powerpc/gen/_set_tp.c
index aa1150a..eeb062f 100644
--- a/lib/libc/powerpc/gen/_set_tp.c
+++ b/lib/libc/powerpc/gen/_set_tp.c
@@ -25,6 +25,7 @@
*
* $FreeBSD$
*/
+#include "libc_private.h"
void
_set_tp(void *tpval)
diff --git a/lib/libc/powerpc64/gen/_set_tp.c b/lib/libc/powerpc64/gen/_set_tp.c
index 32137e5..26009dc 100644
--- a/lib/libc/powerpc64/gen/_set_tp.c
+++ b/lib/libc/powerpc64/gen/_set_tp.c
@@ -25,6 +25,7 @@
*
* $FreeBSD$
*/
+#include "libc_private.h"
void
_set_tp(void *tpval)
diff --git a/lib/libc/resolv/h_errno.c b/lib/libc/resolv/h_errno.c
index 88d15ae..8ced708 100644
--- a/lib/libc/resolv/h_errno.c
+++ b/lib/libc/resolv/h_errno.c
@@ -33,6 +33,9 @@
#undef h_errno
extern int h_errno;
+int *__h_errno(void);
+void __h_errno_set(res_state res, int err);
+
int *
__h_errno(void)
{
diff --git a/lib/libc/resolv/res_debug.c b/lib/libc/resolv/res_debug.c
index 8ab0263..3764601 100644
--- a/lib/libc/resolv/res_debug.c
+++ b/lib/libc/resolv/res_debug.c
@@ -367,11 +367,8 @@ p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
length supplied). */
const u_char *
-p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
+p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name,
+ int namelen)
{
int n, newlen;
@@ -758,8 +755,7 @@ static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
/*% takes an XeY precision/size value, returns a string representation. */
static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
+precsize_ntoa(u_int8_t prec)
{
char *retbuf = precsize_ntoa_retbuf;
unsigned long val;
@@ -912,9 +908,7 @@ latlon2ul(const char **latlonstrptr, int *which) {
* converts a zone file representation in a string to an RDATA on-the-wire
* representation. */
int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
+loc_aton(const char *ascii, u_char *binary)
{
const char *cp, *maxcp;
u_char *bcp;
@@ -1023,9 +1017,7 @@ loc_aton(ascii, binary)
/*% takes an on-the-wire LOC RR and formats it in a human readable format. */
const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
+loc_ntoa(const u_char *binary, char *ascii)
{
static const char *error = "?";
static char tmpbuf[sizeof
diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c
index b5444ef..4dbd6d1 100644
--- a/lib/libc/resolv/res_init.c
+++ b/lib/libc/resolv/res_init.c
@@ -718,8 +718,7 @@ res_setoptions(res_state statp, const char *options, const char *source)
#ifdef RESOLVSORT
/* XXX - should really support CIDR which means explicit masks always. */
static u_int32_t
-net_mask(in) /*!< XXX - should really use system's version of this */
- struct in_addr in;
+net_mask(struct in_addr in) /*!< XXX - should really use system's version of this */
{
u_int32_t i = ntohl(in.s_addr);
diff --git a/lib/libc/resolv/res_mkupdate.c b/lib/libc/resolv/res_mkupdate.c
index 00bce4c..d4981a5 100644
--- a/lib/libc/resolv/res_mkupdate.c
+++ b/lib/libc/resolv/res_mkupdate.c
@@ -973,7 +973,7 @@ struct valuelist {
static struct valuelist *servicelist, *protolist;
static void
-res_buildservicelist() {
+res_buildservicelist(void) {
struct servent *sp;
struct valuelist *slp;
diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c
index fd1cd06..5690491 100644
--- a/lib/libc/resolv/res_send.c
+++ b/lib/libc/resolv/res_send.c
@@ -574,8 +574,7 @@ res_nsend(res_state statp,
/* Private */
static int
-get_salen(sa)
- const struct sockaddr *sa;
+get_salen(const struct sockaddr *sa)
{
#ifdef HAVE_SA_LEN
@@ -596,9 +595,7 @@ get_salen(sa)
* pick appropriate nsaddr_list for use. see res_init() for initialization.
*/
static struct sockaddr *
-get_nsaddr(statp, n)
- res_state statp;
- size_t n;
+get_nsaddr(res_state statp, size_t n)
{
if (!statp->nsaddr_list[n].sin_family && EXT(statp).ext) {
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c
index 1ec5430..1404335 100644
--- a/lib/libc/rpc/auth_unix.c
+++ b/lib/libc/rpc/auth_unix.c
@@ -91,12 +91,7 @@ struct audata {
* Returns an auth handle with the given stuff in it.
*/
AUTH *
-authunix_create(machname, uid, gid, len, aup_gids)
- char *machname;
- u_int uid;
- u_int gid;
- int len;
- u_int *aup_gids;
+authunix_create(char *machname, u_int uid, u_int gid, int len, u_int *aup_gids)
{
struct authunix_parms aup;
char mymem[MAX_AUTH_BYTES];
@@ -182,7 +177,7 @@ authunix_create(machname, uid, gid, len, aup_gids)
* syscalls.
*/
AUTH *
-authunix_create_default()
+authunix_create_default(void)
{
AUTH *auth;
int ngids;
@@ -218,16 +213,13 @@ authunix_create_default()
/* ARGSUSED */
static void
-authunix_nextverf(auth)
- AUTH *auth;
+authunix_nextverf(AUTH *auth)
{
/* no action necessary */
}
static bool_t
-authunix_marshal(auth, xdrs)
- AUTH *auth;
- XDR *xdrs;
+authunix_marshal(AUTH *auth, XDR *xdrs)
{
struct audata *au;
@@ -239,9 +231,7 @@ authunix_marshal(auth, xdrs)
}
static bool_t
-authunix_validate(auth, verf)
- AUTH *auth;
- struct opaque_auth *verf;
+authunix_validate(AUTH *auth, struct opaque_auth *verf)
{
struct audata *au;
XDR xdrs;
@@ -317,8 +307,7 @@ done:
}
static void
-authunix_destroy(auth)
- AUTH *auth;
+authunix_destroy(AUTH *auth)
{
struct audata *au;
@@ -343,8 +332,7 @@ authunix_destroy(auth)
* sets private data, au_marshed and au_mpos
*/
static void
-marshal_new_auth(auth)
- AUTH *auth;
+marshal_new_auth(AUTH *auth)
{
XDR xdr_stream;
XDR *xdrs = &xdr_stream;
@@ -363,7 +351,7 @@ marshal_new_auth(auth)
}
static struct auth_ops *
-authunix_ops()
+authunix_ops(void)
{
static struct auth_ops ops;
diff --git a/lib/libc/rpc/authdes_prot.c b/lib/libc/rpc/authdes_prot.c
index ae12973..0d4bec0 100644
--- a/lib/libc/rpc/authdes_prot.c
+++ b/lib/libc/rpc/authdes_prot.c
@@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
bool_t
-xdr_authdes_cred(xdrs, cred)
- XDR *xdrs;
- struct authdes_cred *cred;
+xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred)
{
enum authdes_namekind *padc_namekind = &cred->adc_namekind;
/*
@@ -78,9 +76,7 @@ xdr_authdes_cred(xdrs, cred)
bool_t
-xdr_authdes_verf(xdrs, verf)
- XDR *xdrs;
- struct authdes_verf *verf;
+xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf)
{
/*
* Unrolled xdr
diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c
index 42a5fad..cd6676b 100644
--- a/lib/libc/rpc/authunix_prot.c
+++ b/lib/libc/rpc/authunix_prot.c
@@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$");
* XDR for unix authentication parameters.
*/
bool_t
-xdr_authunix_parms(xdrs, p)
- XDR *xdrs;
- struct authunix_parms *p;
+xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)
{
u_int **paup_gids;
diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c
index c8b1646..8629cba 100644
--- a/lib/libc/rpc/bindresvport.c
+++ b/lib/libc/rpc/bindresvport.c
@@ -61,9 +61,7 @@ __FBSDID("$FreeBSD$");
* Bind a socket to a privileged IP port
*/
int
-bindresvport(sd, sin)
- int sd;
- struct sockaddr_in *sin;
+bindresvport(int sd, struct sockaddr_in *sin)
{
return bindresvport_sa(sd, (struct sockaddr *)sin);
}
@@ -72,9 +70,7 @@ bindresvport(sd, sin)
* Bind a socket to a privileged IP port
*/
int
-bindresvport_sa(sd, sa)
- int sd;
- struct sockaddr *sa;
+bindresvport_sa(int sd, struct sockaddr *sa)
{
int old, error, af;
struct sockaddr_storage myaddr;
diff --git a/lib/libc/rpc/clnt_bcast.c b/lib/libc/rpc/clnt_bcast.c
index 63d3bec..7242aa4 100644
--- a/lib/libc/rpc/clnt_bcast.c
+++ b/lib/libc/rpc/clnt_bcast.c
@@ -225,21 +225,26 @@ __rpc_broadenable(int af, int s, struct broadif *bip)
return 0;
}
-
+/*
+ * rpc_broadcast_exp()
+ *
+ * prog - program number
+ * vers - version number
+ * proc - procedure number
+ * xargs - xdr routine for args
+ * argsp - pointer to args
+ * xresults - xdr routine for results
+ * resultsp - pointer to results
+ * eachresult - call with each result obtained
+ * inittime - how long to wait initially
+ * waittime - maximum time to wait
+ * nettype - transport type
+ */
enum clnt_stat
-rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
- eachresult, inittime, waittime, nettype)
- rpcprog_t prog; /* program number */
- rpcvers_t vers; /* version number */
- rpcproc_t proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- resultproc_t eachresult; /* call with each result obtained */
- int inittime; /* how long to wait initially */
- int waittime; /* maximum time to wait */
- const char *nettype; /* transport type */
+rpc_broadcast_exp(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
+ xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults, caddr_t resultsp,
+ resultproc_t eachresult, int inittime, int waittime,
+ const char *nettype)
{
enum clnt_stat stat = RPC_SUCCESS; /* Return status */
XDR xdr_stream; /* XDR stream */
@@ -649,19 +654,23 @@ done_broad:
return (stat);
}
-
+/*
+ * rpc_broadcast()
+ *
+ * prog - program number
+ * vers - version number
+ * proc - procedure number
+ * xargs - xdr routine for args
+ * argsp - pointer to args
+ * xresults - xdr routine for results
+ * resultsp - pointer to results
+ * eachresult - call with each result obtained
+ * nettype - transport type
+ */
enum clnt_stat
-rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
- eachresult, nettype)
- rpcprog_t prog; /* program number */
- rpcvers_t vers; /* version number */
- rpcproc_t proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- resultproc_t eachresult; /* call with each result obtained */
- const char *nettype; /* transport type */
+rpc_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc, xdrproc_t xargs,
+ caddr_t argsp, xdrproc_t xresults, caddr_t resultsp,
+ resultproc_t eachresult, const char *nettype)
{
enum clnt_stat dummy;
diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c
index 5d87b0c..15d7280 100644
--- a/lib/libc/rpc/clnt_perror.c
+++ b/lib/libc/rpc/clnt_perror.c
@@ -61,7 +61,7 @@ static char *auth_errmsg(enum auth_stat);
#define CLNT_PERROR_BUFLEN 256
static char *
-_buf()
+_buf(void)
{
if (buf == 0)
@@ -73,9 +73,7 @@ _buf()
* Print reply error info
*/
char *
-clnt_sperror(rpch, s)
- CLIENT *rpch;
- const char *s;
+clnt_sperror(CLIENT *rpch, const char *s)
{
struct rpc_err e;
char *err;
@@ -180,9 +178,7 @@ clnt_sperror(rpch, s)
}
void
-clnt_perror(rpch, s)
- CLIENT *rpch;
- const char *s;
+clnt_perror(CLIENT *rpch, const char *s)
{
assert(rpch != NULL);
@@ -217,8 +213,7 @@ static const char *const rpc_errlist[] = {
* This interface for use by clntrpc
*/
char *
-clnt_sperrno(stat)
- enum clnt_stat stat;
+clnt_sperrno(enum clnt_stat stat)
{
unsigned int errnum = stat;
@@ -230,16 +225,14 @@ clnt_sperrno(stat)
}
void
-clnt_perrno(num)
- enum clnt_stat num;
+clnt_perrno(enum clnt_stat num)
{
(void) fprintf(stderr, "%s\n", clnt_sperrno(num));
}
char *
-clnt_spcreateerror(s)
- const char *s;
+clnt_spcreateerror(const char *s)
{
char *str;
size_t len, i;
@@ -291,8 +284,7 @@ clnt_spcreateerror(s)
}
void
-clnt_pcreateerror(s)
- const char *s;
+clnt_pcreateerror(const char *s)
{
assert(s != NULL);
@@ -319,8 +311,7 @@ static const char *const auth_errlist[] = {
};
static char *
-auth_errmsg(stat)
- enum auth_stat stat;
+auth_errmsg(enum auth_stat stat)
{
unsigned int errnum = stat;
diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c
index 26e2856..ad64112 100644
--- a/lib/libc/rpc/clnt_raw.c
+++ b/lib/libc/rpc/clnt_raw.c
@@ -87,9 +87,7 @@ static struct clnt_ops *clnt_raw_ops(void);
* Create a client handle for memory based rpc.
*/
CLIENT *
-clnt_raw_create(prog, vers)
- rpcprog_t prog;
- rpcvers_t vers;
+clnt_raw_create(rpcprog_t prog, rpcvers_t vers)
{
struct clntraw_private *clp;
struct rpc_msg call_msg;
@@ -142,14 +140,8 @@ clnt_raw_create(prog, vers)
/* ARGSUSED */
static enum clnt_stat
-clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
- CLIENT *h;
- rpcproc_t proc;
- xdrproc_t xargs;
- void *argsp;
- xdrproc_t xresults;
- void *resultsp;
- struct timeval timeout;
+clnt_raw_call(CLIENT *h, rpcproc_t proc, xdrproc_t xargs, void *argsp,
+ xdrproc_t xresults, void *resultsp, struct timeval timeout)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs = &clp->xdr_stream;
@@ -240,19 +232,14 @@ call_again:
/*ARGSUSED*/
static void
-clnt_raw_geterr(cl, err)
- CLIENT *cl;
- struct rpc_err *err;
+clnt_raw_geterr(CLIENT *cl, struct rpc_err *err)
{
}
/* ARGSUSED */
static bool_t
-clnt_raw_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- void *res_ptr;
+clnt_raw_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs = &clp->xdr_stream;
@@ -271,30 +258,25 @@ clnt_raw_freeres(cl, xdr_res, res_ptr)
/*ARGSUSED*/
static void
-clnt_raw_abort(cl)
- CLIENT *cl;
+clnt_raw_abort(CLIENT *cl)
{
}
/*ARGSUSED*/
static bool_t
-clnt_raw_control(cl, ui, str)
- CLIENT *cl;
- u_int ui;
- void *str;
+clnt_raw_control(CLIENT *cl, u_int ui, void *str)
{
return (FALSE);
}
/*ARGSUSED*/
static void
-clnt_raw_destroy(cl)
- CLIENT *cl;
+clnt_raw_destroy(CLIENT *cl)
{
}
static struct clnt_ops *
-clnt_raw_ops()
+clnt_raw_ops(void)
{
static struct clnt_ops ops;
diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c
index 3541205..4fc374a 100644
--- a/lib/libc/rpc/clnt_simple.c
+++ b/lib/libc/rpc/clnt_simple.c
@@ -107,17 +107,19 @@ rpc_call_key_init(void)
* the future calls to same prog, vers, host and nettype combination.
*
* The total time available is 25 seconds.
+ *
+ * host - host name
+ * prognum - program number
+ * versnum - version number
+ * procnum - procedure number
+ * inproc, outproc - in/out XDR procedures
+ * in, out - recv/send data
+ * nettype - nettype
*/
enum clnt_stat
-rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
- const char *host; /* host name */
- rpcprog_t prognum; /* program number */
- rpcvers_t versnum; /* version number */
- rpcproc_t procnum; /* procedure number */
- xdrproc_t inproc, outproc; /* in/out XDR procedures */
- const char *in;
- char *out; /* recv/send data */
- const char *nettype; /* nettype */
+rpc_call(const char *host, const rpcprog_t prognum, const rpcvers_t versnum,
+ const rpcproc_t procnum, const xdrproc_t inproc, const char *in,
+ const xdrproc_t outproc, char *out, const char *nettype)
{
struct rpc_call_private *rcp = (struct rpc_call_private *) 0;
enum clnt_stat clnt_stat;
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c
index b15d69b..e463165 100644
--- a/lib/libc/rpc/clnt_vc.c
+++ b/lib/libc/rpc/clnt_vc.c
@@ -153,15 +153,17 @@ static const char __no_mem_str[] = "out of memory";
* set this something more useful.
*
* fd should be an open socket
+ *
+ * fd - open file descriptor
+ * raddr - servers address
+ * prog - program number
+ * vers - version number
+ * sendsz - buffer send size
+ * recvsz - buffer recv size
*/
CLIENT *
-clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
- int fd; /* open file descriptor */
- const struct netbuf *raddr; /* servers address */
- const rpcprog_t prog; /* program number */
- const rpcvers_t vers; /* version number */
- u_int sendsz; /* buffer recv size */
- u_int recvsz; /* buffer send size */
+clnt_vc_create(int fd, const struct netbuf *raddr, const rpcprog_t prog,
+ const rpcvers_t vers, u_int sendsz, u_int recvsz)
{
CLIENT *cl; /* client handle */
struct ct_data *ct = NULL; /* client handle */
@@ -311,14 +313,8 @@ err:
}
static enum clnt_stat
-clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
- CLIENT *cl;
- rpcproc_t proc;
- xdrproc_t xdr_args;
- void *args_ptr;
- xdrproc_t xdr_results;
- void *results_ptr;
- struct timeval timeout;
+clnt_vc_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xdr_args, void *args_ptr,
+ xdrproc_t xdr_results, void *results_ptr, struct timeval timeout)
{
struct ct_data *ct = (struct ct_data *) cl->cl_private;
XDR *xdrs = &(ct->ct_xdrs);
@@ -461,9 +457,7 @@ call_again:
}
static void
-clnt_vc_geterr(cl, errp)
- CLIENT *cl;
- struct rpc_err *errp;
+clnt_vc_geterr(CLIENT *cl, struct rpc_err *errp)
{
struct ct_data *ct;
@@ -475,10 +469,7 @@ clnt_vc_geterr(cl, errp)
}
static bool_t
-clnt_vc_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- void *res_ptr;
+clnt_vc_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr)
{
struct ct_data *ct;
XDR *xdrs;
@@ -507,16 +498,12 @@ clnt_vc_freeres(cl, xdr_res, res_ptr)
/*ARGSUSED*/
static void
-clnt_vc_abort(cl)
- CLIENT *cl;
+clnt_vc_abort(CLIENT *cl)
{
}
static bool_t
-clnt_vc_control(cl, request, info)
- CLIENT *cl;
- u_int request;
- void *info;
+clnt_vc_control(CLIENT *cl, u_int request, void *info)
{
struct ct_data *ct;
void *infop = info;
@@ -644,8 +631,7 @@ clnt_vc_control(cl, request, info)
static void
-clnt_vc_destroy(cl)
- CLIENT *cl;
+clnt_vc_destroy(CLIENT *cl)
{
struct ct_data *ct = (struct ct_data *) cl->cl_private;
int ct_fd = ct->ct_fd;
@@ -684,10 +670,7 @@ clnt_vc_destroy(cl)
* around for the rpc level.
*/
static int
-read_vc(ctp, buf, len)
- void *ctp;
- void *buf;
- int len;
+read_vc(void *ctp, void *buf, int len)
{
struct sockaddr sa;
socklen_t sal;
@@ -741,10 +724,7 @@ read_vc(ctp, buf, len)
}
static int
-write_vc(ctp, buf, len)
- void *ctp;
- void *buf;
- int len;
+write_vc(void *ctp, void *buf, int len)
{
struct sockaddr sa;
socklen_t sal;
@@ -775,7 +755,7 @@ write_vc(ctp, buf, len)
}
static struct clnt_ops *
-clnt_vc_ops()
+clnt_vc_ops(void)
{
static struct clnt_ops ops;
sigset_t mask, newmask;
@@ -803,18 +783,14 @@ clnt_vc_ops()
* Note this is different from time_not_ok in clnt_dg.c
*/
static bool_t
-time_not_ok(t)
- struct timeval *t;
+time_not_ok(struct timeval *t)
{
return (t->tv_sec <= -1 || t->tv_sec > 100000000 ||
t->tv_usec <= -1 || t->tv_usec > 1000000);
}
static int
-__msgread(sock, buf, cnt)
- int sock;
- void *buf;
- size_t cnt;
+__msgread(int sock, void *buf, size_t cnt)
{
struct iovec iov[1];
struct msghdr msg;
@@ -839,10 +815,7 @@ __msgread(sock, buf, cnt)
}
static int
-__msgwrite(sock, buf, cnt)
- int sock;
- void *buf;
- size_t cnt;
+__msgwrite(int sock, void *buf, size_t cnt)
{
struct iovec iov[1];
struct msghdr msg;
diff --git a/lib/libc/rpc/des_crypt.c b/lib/libc/rpc/des_crypt.c
index b54af4f..236e9ed 100644
--- a/lib/libc/rpc/des_crypt.c
+++ b/lib/libc/rpc/des_crypt.c
@@ -41,7 +41,7 @@ static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02
__FBSDID("$FreeBSD$");
static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
-int (*__des_crypt_LOCAL)() = 0;
+int (*__des_crypt_LOCAL)(char *, unsigned, struct desparams *) = 0;
extern int _des_crypt_call(char *, int, struct desparams *);
/*
* Copy 8 bytes
diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c
index 34be6e1..c1e22da 100644
--- a/lib/libc/rpc/getnetconfig.c
+++ b/lib/libc/rpc/getnetconfig.c
@@ -147,7 +147,7 @@ nc_key_init(void)
#define MAXNETCONFIGLINE 1000
static int *
-__nc_error()
+__nc_error(void)
{
static int nc_error = 0;
int *nc_addr;
@@ -194,7 +194,7 @@ __nc_error()
* the netconfig database is not present).
*/
void *
-setnetconfig()
+setnetconfig(void)
{
struct netconfig_vars *nc_vars;
@@ -240,8 +240,7 @@ setnetconfig()
*/
struct netconfig *
-getnetconfig(handlep)
-void *handlep;
+getnetconfig(void *handlep)
{
struct netconfig_vars *ncp = (struct netconfig_vars *)handlep;
char *stringp; /* tmp string pointer */
@@ -378,8 +377,7 @@ void *handlep;
* previously).
*/
int
-endnetconfig(handlep)
-void *handlep;
+endnetconfig(void *handlep)
{
struct netconfig_vars *nc_handlep = (struct netconfig_vars *)handlep;
@@ -444,8 +442,7 @@ void *handlep;
*/
struct netconfig *
-getnetconfigent(netid)
- const char *netid;
+getnetconfigent(const char *netid)
{
FILE *file; /* NETCONFIG db's file pointer */
char *linep; /* holds current netconfig line */
@@ -536,8 +533,7 @@ getnetconfigent(netid)
*/
void
-freenetconfigent(netconfigp)
- struct netconfig *netconfigp;
+freenetconfigent(struct netconfig *netconfigp)
{
if (netconfigp != NULL) {
free(netconfigp->nc_netid); /* holds all netconfigp's strings */
@@ -558,12 +554,13 @@ freenetconfigent(netconfigp)
* Note that we modify stringp (putting NULLs after tokens) and
* we set the ncp's string field pointers to point to these tokens within
* stringp.
+ *
+ * stringp - string to parse
+ * ncp - where to put results
*/
static int
-parse_ncp(stringp, ncp)
-char *stringp; /* string to parse */
-struct netconfig *ncp; /* where to put results */
+parse_ncp(char *stringp, struct netconfig *ncp)
{
char *tokenp; /* for processing tokens */
char *lasts;
@@ -655,7 +652,7 @@ struct netconfig *ncp; /* where to put results */
* Returns a string describing the reason for failure.
*/
char *
-nc_sperror()
+nc_sperror(void)
{
const char *message;
@@ -686,8 +683,7 @@ nc_sperror()
* Prints a message onto standard error describing the reason for failure.
*/
void
-nc_perror(s)
- const char *s;
+nc_perror(const char *s)
{
fprintf(stderr, "%s: %s\n", s, nc_sperror());
}
@@ -696,8 +692,7 @@ nc_perror(s)
* Duplicates the matched netconfig buffer.
*/
static struct netconfig *
-dup_ncp(ncp)
-struct netconfig *ncp;
+dup_ncp(struct netconfig *ncp)
{
struct netconfig *p;
char *tmp;
diff --git a/lib/libc/rpc/getnetpath.c b/lib/libc/rpc/getnetpath.c
index 29155c7..ce2984b 100644
--- a/lib/libc/rpc/getnetpath.c
+++ b/lib/libc/rpc/getnetpath.c
@@ -82,7 +82,7 @@ char *_get_next_token(char *, int);
*/
void *
-setnetpath()
+setnetpath(void)
{
struct netpath_vars *np_sessionp; /* this session's variables */
@@ -141,8 +141,7 @@ failed:
*/
struct netconfig *
-getnetpath(handlep)
- void *handlep;
+getnetpath(void *handlep)
{
struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep;
struct netconfig *ncp = NULL; /* temp. holds a netconfig session */
@@ -197,8 +196,7 @@ getnetpath(handlep)
* (e.g. if setnetpath() was not called previously.
*/
int
-endnetpath(handlep)
- void *handlep;
+endnetpath(void *handlep)
{
struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep;
struct netpath_chain *chainp, *lastp;
@@ -231,12 +229,12 @@ endnetpath(handlep)
* Returns pointer to the rest-of-the-string after the current token.
* The token itself starts at arg, and we null terminate it. We return NULL
* if either the arg is empty, or if this is the last token.
+ *
+ * npp - string
+ * token - char to parse string for
*/
-
char *
-_get_next_token(npp, token)
-char *npp; /* string */
-int token; /* char to parse string for */
+_get_next_token(char *npp, int token)
{
char *cp; /* char pointer */
char *np; /* netpath pointer */
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index fa404d8..72c5da8 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -989,7 +989,7 @@ getrpcbynumber(int number)
}
struct rpcent *
-getrpcent()
+getrpcent(void)
{
union key key;
@@ -1023,7 +1023,7 @@ setrpcent(int stayopen)
}
void
-endrpcent()
+endrpcent(void)
{
#ifdef NS_CACHING
static const nss_cache_info cache_info = NS_MP_CACHE_INFO_INITIALIZER(
diff --git a/lib/libc/rpc/getrpcport.c b/lib/libc/rpc/getrpcport.c
index 1ceaa3f..b365678 100644
--- a/lib/libc/rpc/getrpcport.c
+++ b/lib/libc/rpc/getrpcport.c
@@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
int
-getrpcport(host, prognum, versnum, proto)
- char *host;
- int prognum, versnum, proto;
+getrpcport(char *host, int prognum, int versnum, int proto)
{
struct sockaddr_in addr;
struct hostent *hp;
diff --git a/lib/libc/rpc/mt_misc.c b/lib/libc/rpc/mt_misc.c
index 7abcaed..2e17c27 100644
--- a/lib/libc/rpc/mt_misc.c
+++ b/lib/libc/rpc/mt_misc.c
@@ -93,7 +93,7 @@ rce_key_init(void)
}
struct rpc_createerr *
-__rpc_createerr()
+__rpc_createerr(void)
{
struct rpc_createerr *rce_addr = 0;
diff --git a/lib/libc/rpc/netname.c b/lib/libc/rpc/netname.c
index 7b1661e..77b522b 100644
--- a/lib/libc/rpc/netname.c
+++ b/lib/libc/rpc/netname.c
@@ -79,8 +79,7 @@ static char *OPSYS = "unix";
* Figure out my fully qualified network name
*/
int
-getnetname(name)
- char name[MAXNETNAMELEN+1];
+getnetname(char name[MAXNETNAMELEN+1])
{
uid_t uid;
@@ -97,10 +96,7 @@ getnetname(name)
* Convert unix cred to network-name
*/
int
-user2netname(netname, uid, domain)
- char netname[MAXNETNAMELEN + 1];
- const uid_t uid;
- const char *domain;
+user2netname(char netname[MAXNETNAMELEN + 1], const uid_t uid, const char *domain)
{
char *dfltdom;
@@ -122,10 +118,7 @@ user2netname(netname, uid, domain)
* Convert host to network-name
*/
int
-host2netname(netname, host, domain)
- char netname[MAXNETNAMELEN + 1];
- const char *host;
- const char *domain;
+host2netname(char netname[MAXNETNAMELEN + 1], const char *host, const char *domain)
{
char *dfltdom;
char hostname[MAXHOSTNAMELEN+1];
diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c
index fce4b4d..e7a2972 100644
--- a/lib/libc/rpc/netnamer.c
+++ b/lib/libc/rpc/netnamer.c
@@ -68,12 +68,8 @@ static int _getgroups( char *, gid_t * );
* Convert network-name into unix credential
*/
int
-netname2user(netname, uidp, gidp, gidlenp, gidlist)
- char netname[MAXNETNAMELEN + 1];
- uid_t *uidp;
- gid_t *gidp;
- int *gidlenp;
- gid_t *gidlist;
+netname2user(char netname[MAXNETNAMELEN + 1], uid_t *uidp, gid_t *gidp,
+ int *gidlenp, gid_t *gidlist)
{
char *p;
int gidlen;
@@ -149,9 +145,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist)
*/
static int
-_getgroups(uname, groups)
- char *uname;
- gid_t groups[NGRPS];
+_getgroups(char *uname, gid_t groups[NGRPS])
{
gid_t ngroups = 0;
struct group *grp;
@@ -190,10 +184,7 @@ toomany:
* Convert network-name to hostname
*/
int
-netname2host(netname, hostname, hostlen)
- char netname[MAXNETNAMELEN + 1];
- char *hostname;
- int hostlen;
+netname2host(char netname[MAXNETNAMELEN + 1], char *hostname, int hostlen)
{
int err;
char valbuf[1024];
@@ -239,8 +230,7 @@ netname2host(netname, hostname, hostlen)
* network information service.
*/
int
-getnetid(key, ret)
- char *key, *ret;
+getnetid(char *key, char *ret)
{
char buf[1024]; /* big enough */
char *res;
diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c
index 34e254a..1049005 100644
--- a/lib/libc/rpc/pmap_getmaps.c
+++ b/lib/libc/rpc/pmap_getmaps.c
@@ -70,8 +70,7 @@ __FBSDID("$FreeBSD$");
* Calls the pmap service remotely to do get the maps.
*/
struct pmaplist *
-pmap_getmaps(address)
- struct sockaddr_in *address;
+pmap_getmaps(struct sockaddr_in *address)
{
struct pmaplist *head = NULL;
int sock = -1;
diff --git a/lib/libc/rpc/pmap_getport.c b/lib/libc/rpc/pmap_getport.c
index e06f958..c1e0c7a 100644
--- a/lib/libc/rpc/pmap_getport.c
+++ b/lib/libc/rpc/pmap_getport.c
@@ -66,11 +66,8 @@ static const struct timeval tottimeout = { 60, 0 };
* Returns 0 if no map exists.
*/
u_short
-pmap_getport(address, program, version, protocol)
- struct sockaddr_in *address;
- u_long program;
- u_long version;
- u_int protocol;
+pmap_getport(struct sockaddr_in *address, u_long program, u_long version,
+ u_int protocol)
{
u_short port = 0;
int sock = -1;
diff --git a/lib/libc/rpc/pmap_prot.c b/lib/libc/rpc/pmap_prot.c
index 1967467..bf01672 100644
--- a/lib/libc/rpc/pmap_prot.c
+++ b/lib/libc/rpc/pmap_prot.c
@@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$");
bool_t
-xdr_pmap(xdrs, regs)
- XDR *xdrs;
- struct pmap *regs;
+xdr_pmap(XDR *xdrs, struct pmap *regs)
{
assert(xdrs != NULL);
diff --git a/lib/libc/rpc/pmap_prot2.c b/lib/libc/rpc/pmap_prot2.c
index 56a1198..f892afb 100644
--- a/lib/libc/rpc/pmap_prot2.c
+++ b/lib/libc/rpc/pmap_prot2.c
@@ -90,9 +90,7 @@ __FBSDID("$FreeBSD$");
* this sounds like a job for xdr_reference!
*/
bool_t
-xdr_pmaplist(xdrs, rp)
- XDR *xdrs;
- struct pmaplist **rp;
+xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
{
/*
* more_elements is pre-computed in case the direction is
@@ -134,9 +132,7 @@ xdr_pmaplist(xdrs, rp)
* functionality to xdr_pmaplist().
*/
bool_t
-xdr_pmaplist_ptr(xdrs, rp)
- XDR *xdrs;
- struct pmaplist *rp;
+xdr_pmaplist_ptr(XDR *xdrs, struct pmaplist *rp)
{
return xdr_pmaplist(xdrs, (struct pmaplist **)(void *)rp);
}
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c
index fe7b432..1241204 100644
--- a/lib/libc/rpc/pmap_rmt.c
+++ b/lib/libc/rpc/pmap_rmt.c
@@ -76,14 +76,9 @@ static const struct timeval timeout = { 3, 0 };
* programs to do a lookup and call in one step.
*/
enum clnt_stat
-pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
- port_ptr)
- struct sockaddr_in *addr;
- u_long prog, vers, proc;
- xdrproc_t xdrargs, xdrres;
- caddr_t argsp, resp;
- struct timeval tout;
- u_long *port_ptr;
+pmap_rmtcall(struct sockaddr_in *addr, u_long prog, u_long vers, u_long proc,
+ xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
+ struct timeval tout, u_long *port_ptr)
{
int sock = -1;
CLIENT *client;
@@ -122,9 +117,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
* written for XDR_ENCODE direction only
*/
bool_t
-xdr_rmtcall_args(xdrs, cap)
- XDR *xdrs;
- struct rmtcallargs *cap;
+xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
{
u_int lenposition, argposition, position;
@@ -156,9 +149,7 @@ xdr_rmtcall_args(xdrs, cap)
* written for XDR_DECODE direction only
*/
bool_t
-xdr_rmtcallres(xdrs, crp)
- XDR *xdrs;
- struct rmtcallres *crp;
+xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp)
{
caddr_t port_ptr;
diff --git a/lib/libc/rpc/rpc_callmsg.c b/lib/libc/rpc/rpc_callmsg.c
index 5b7ea49..0e29e09 100644
--- a/lib/libc/rpc/rpc_callmsg.c
+++ b/lib/libc/rpc/rpc_callmsg.c
@@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$");
* XDR a call message
*/
bool_t
-xdr_callmsg(xdrs, cmsg)
- XDR *xdrs;
- struct rpc_msg *cmsg;
+xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg)
{
enum msg_type *prm_direction;
int32_t *buf;
diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c
index 57ef267..fe970e1 100644
--- a/lib/libc/rpc/rpc_generic.c
+++ b/lib/libc/rpc/rpc_generic.c
@@ -111,7 +111,7 @@ static int getnettype(const char *);
* expensive call every time.
*/
int
-__rpc_dtbsize()
+__rpc_dtbsize(void)
{
static int tbsize;
struct rlimit rl;
@@ -132,12 +132,12 @@ __rpc_dtbsize()
/*
* Find the appropriate buffer size
+ *
+ * size - Size requested
*/
u_int
/*ARGSUSED*/
-__rpc_get_t_size(af, proto, size)
- int af, proto;
- int size; /* Size requested */
+__rpc_get_t_size(int af, int proto, int size)
{
int maxsize, defsize;
@@ -164,8 +164,7 @@ __rpc_get_t_size(af, proto, size)
* Find the appropriate address buffer size
*/
u_int
-__rpc_get_a_size(af)
- int af;
+__rpc_get_a_size(int af)
{
switch (af) {
case AF_INET:
@@ -184,8 +183,7 @@ __rpc_get_a_size(af)
#if 0
static char *
-strlocase(p)
- char *p;
+strlocase(char *p)
{
char *t = p;
@@ -201,8 +199,7 @@ strlocase(p)
* If nettype is NULL, it defaults to NETPATH.
*/
static int
-getnettype(nettype)
- const char *nettype;
+getnettype(const char *nettype)
{
int i;
@@ -237,8 +234,7 @@ keys_init(void)
* This should be freed by calling freenetconfigent()
*/
struct netconfig *
-__rpc_getconfip(nettype)
- const char *nettype;
+__rpc_getconfip(const char *nettype)
{
char *netid;
char *netid_tcp = (char *) NULL;
@@ -309,8 +305,7 @@ __rpc_getconfip(nettype)
* __rpc_getconf().
*/
void *
-__rpc_setconf(nettype)
- const char *nettype;
+__rpc_setconf(const char *nettype)
{
struct handle *handle;
@@ -353,8 +348,7 @@ failed:
* __rpc_setconf() should have been called previously.
*/
struct netconfig *
-__rpc_getconf(vhandle)
- void *vhandle;
+__rpc_getconf(void *vhandle)
{
struct handle *handle;
struct netconfig *nconf;
@@ -430,8 +424,7 @@ __rpc_getconf(vhandle)
}
void
-__rpc_endconf(vhandle)
- void * vhandle;
+__rpc_endconf(void *vhandle)
{
struct handle *handle;
@@ -452,8 +445,7 @@ __rpc_endconf(vhandle)
* Returns NULL if fails, else a non-NULL pointer.
*/
void *
-rpc_nullproc(clnt)
- CLIENT *clnt;
+rpc_nullproc(CLIENT *clnt)
{
struct timeval TIMEOUT = {25, 0};
@@ -469,8 +461,7 @@ rpc_nullproc(clnt)
* one succeeds in finding the netconf for the given fd.
*/
struct netconfig *
-__rpcgettp(fd)
- int fd;
+__rpcgettp(int fd)
{
const char *netid;
struct __rpc_sockinfo si;
diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c
index d4fdd90..53fc70a 100644
--- a/lib/libc/rpc/rpc_prot.c
+++ b/lib/libc/rpc/rpc_prot.c
@@ -265,9 +265,7 @@ accepted(enum accept_stat acpt_stat, struct rpc_err *error)
}
static void
-rejected(rjct_stat, error)
- enum reject_stat rjct_stat;
- struct rpc_err *error;
+rejected(enum reject_stat rjct_stat, struct rpc_err *error)
{
assert(error != NULL);
@@ -292,9 +290,7 @@ rejected(rjct_stat, error)
* given a reply message, fills in the error
*/
void
-_seterr_reply(msg, error)
- struct rpc_msg *msg;
- struct rpc_err *error;
+_seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
{
assert(msg != NULL);
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index b7f6651..8fc91ff 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -270,7 +270,7 @@ svcudp_create(int fd)
}
SVCXPRT *
-svcraw_create()
+svcraw_create(void)
{
return svc_raw_create();
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index c0c8c03..d53d908 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -194,10 +194,8 @@ delete_cache(struct netbuf *addr)
}
static void
-add_cache(host, netid, taddr, uaddr)
- const char *host, *netid;
- char *uaddr;
- struct netbuf *taddr;
+add_cache(const char *host, const char *netid, struct netbuf *taddr,
+ char *uaddr)
{
struct address_cache *ad_cache, *cptr, *prevptr;
@@ -428,7 +426,7 @@ getclnthandle(const char *host, const struct netconfig *nconf, char **targaddr)
* rpcbind. Returns NULL on error and free's everything.
*/
static CLIENT *
-local_rpcb()
+local_rpcb(void)
{
CLIENT *client;
static struct netconfig *loopnconf;
@@ -1101,19 +1099,20 @@ done:
* which will look up a service program in the address maps, and then
* remotely call that routine with the given parameters. This allows
* programs to do a lookup and call in one step.
-*/
+ *
+ * nconf -Netconfig structure
+ * host - Remote host name
+ * proc - Remote proc identifiers
+ * xdrargs, xdrres; XDR routines
+ * argsp, resp - Argument and Result
+ * tout - Timeout value for this call
+ * addr_ptr - Preallocated netbuf address
+ */
enum clnt_stat
-rpcb_rmtcall(nconf, host, prog, vers, proc, xdrargs, argsp,
- xdrres, resp, tout, addr_ptr)
- const struct netconfig *nconf; /* Netconfig structure */
- const char *host; /* Remote host name */
- rpcprog_t prog;
- rpcvers_t vers;
- rpcproc_t proc; /* Remote proc identifiers */
- xdrproc_t xdrargs, xdrres; /* XDR routines */
- caddr_t argsp, resp; /* Argument and Result */
- struct timeval tout; /* Timeout value for this call */
- const struct netbuf *addr_ptr; /* Preallocated netbuf address */
+rpcb_rmtcall(const struct netconfig *nconf, const char *host, rpcprog_t prog,
+ rpcvers_t vers, rpcproc_t proc, xdrproc_t xdrargs, caddr_t argsp,
+ xdrproc_t xdrres, caddr_t resp, struct timeval tout,
+ const struct netbuf *addr_ptr)
{
CLIENT *client;
enum clnt_stat stat;
diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c
index f543aaf..b793eca 100644
--- a/lib/libc/rpc/rpcb_prot.c
+++ b/lib/libc/rpc/rpcb_prot.c
@@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
bool_t
-xdr_rpcb(xdrs, objp)
- XDR *xdrs;
- RPCB *objp;
+xdr_rpcb(XDR *xdrs, RPCB *objp)
{
if (!xdr_u_int32_t(xdrs, &objp->r_prog)) {
return (FALSE);
@@ -100,9 +98,7 @@ xdr_rpcb(xdrs, objp)
*/
bool_t
-xdr_rpcblist_ptr(xdrs, rp)
- XDR *xdrs;
- rpcblist_ptr *rp;
+xdr_rpcblist_ptr(XDR *xdrs, rpcblist_ptr *rp)
{
/*
* more_elements is pre-computed in case the direction is
@@ -154,9 +150,7 @@ xdr_rpcblist_ptr(xdrs, rp)
* functionality to xdr_rpcblist_ptr().
*/
bool_t
-xdr_rpcblist(xdrs, rp)
- XDR *xdrs;
- RPCBLIST **rp;
+xdr_rpcblist(XDR *xdrs, RPCBLIST **rp)
{
bool_t dummy;
@@ -166,9 +160,7 @@ xdr_rpcblist(xdrs, rp)
bool_t
-xdr_rpcb_entry(xdrs, objp)
- XDR *xdrs;
- rpcb_entry *objp;
+xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp)
{
if (!xdr_string(xdrs, &objp->r_maddr, (u_int)~0)) {
return (FALSE);
@@ -189,9 +181,7 @@ xdr_rpcb_entry(xdrs, objp)
}
bool_t
-xdr_rpcb_entry_list_ptr(xdrs, rp)
- XDR *xdrs;
- rpcb_entry_list_ptr *rp;
+xdr_rpcb_entry_list_ptr(XDR *xdrs, rpcb_entry_list_ptr *rp)
{
/*
* more_elements is pre-computed in case the direction is
@@ -244,9 +234,7 @@ xdr_rpcb_entry_list_ptr(xdrs, rp)
* written for XDR_ENCODE direction only
*/
bool_t
-xdr_rpcb_rmtcallargs(xdrs, p)
- XDR *xdrs;
- struct rpcb_rmtcallargs *p;
+xdr_rpcb_rmtcallargs(XDR *xdrs, struct rpcb_rmtcallargs *p)
{
struct r_rpcb_rmtcallargs *objp =
(struct r_rpcb_rmtcallargs *)(void *)p;
@@ -296,9 +284,7 @@ xdr_rpcb_rmtcallargs(xdrs, p)
* written for XDR_DECODE direction only
*/
bool_t
-xdr_rpcb_rmtcallres(xdrs, p)
- XDR *xdrs;
- struct rpcb_rmtcallres *p;
+xdr_rpcb_rmtcallres(XDR *xdrs, struct rpcb_rmtcallres *p)
{
bool_t dummy;
struct r_rpcb_rmtcallres *objp = (struct r_rpcb_rmtcallres *)(void *)p;
@@ -314,9 +300,7 @@ xdr_rpcb_rmtcallres(xdrs, p)
}
bool_t
-xdr_netbuf(xdrs, objp)
- XDR *xdrs;
- struct netbuf *objp;
+xdr_netbuf(XDR *xdrs, struct netbuf *objp)
{
bool_t dummy;
void **pp;
diff --git a/lib/libc/rpc/rpcb_st_xdr.c b/lib/libc/rpc/rpcb_st_xdr.c
index 8ffc5b6..8919144 100644
--- a/lib/libc/rpc/rpcb_st_xdr.c
+++ b/lib/libc/rpc/rpcb_st_xdr.c
@@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$");
/* Link list of all the stats about getport and getaddr */
bool_t
-xdr_rpcbs_addrlist(xdrs, objp)
- XDR *xdrs;
- rpcbs_addrlist *objp;
+xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
{
struct rpcbs_addrlist **pnext;
@@ -83,9 +81,7 @@ xdr_rpcbs_addrlist(xdrs, objp)
/* Link list of all the stats about rmtcall */
bool_t
-xdr_rpcbs_rmtcalllist(xdrs, objp)
- XDR *xdrs;
- rpcbs_rmtcalllist *objp;
+xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp)
{
int32_t *buf;
struct rpcbs_rmtcalllist **pnext;
@@ -198,9 +194,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
}
bool_t
-xdr_rpcbs_proc(xdrs, objp)
- XDR *xdrs;
- rpcbs_proc objp;
+xdr_rpcbs_proc(XDR *xdrs, rpcbs_proc objp)
{
if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
sizeof (int), (xdrproc_t)xdr_int)) {
@@ -210,9 +204,7 @@ xdr_rpcbs_proc(xdrs, objp)
}
bool_t
-xdr_rpcbs_addrlist_ptr(xdrs, objp)
- XDR *xdrs;
- rpcbs_addrlist_ptr *objp;
+xdr_rpcbs_addrlist_ptr(XDR *xdrs, rpcbs_addrlist_ptr *objp)
{
if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
(xdrproc_t)xdr_rpcbs_addrlist)) {
@@ -222,9 +214,7 @@ xdr_rpcbs_addrlist_ptr(xdrs, objp)
}
bool_t
-xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
- XDR *xdrs;
- rpcbs_rmtcalllist_ptr *objp;
+xdr_rpcbs_rmtcalllist_ptr(XDR *xdrs, rpcbs_rmtcalllist_ptr *objp)
{
if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
@@ -234,9 +224,7 @@ xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
}
bool_t
-xdr_rpcb_stat(xdrs, objp)
- XDR *xdrs;
- rpcb_stat *objp;
+xdr_rpcb_stat(XDR *xdrs, rpcb_stat *objp)
{
if (!xdr_rpcbs_proc(xdrs, objp->info)) {
@@ -262,9 +250,7 @@ xdr_rpcb_stat(xdrs, objp)
* being monitored.
*/
bool_t
-xdr_rpcb_stat_byvers(xdrs, objp)
- XDR *xdrs;
- rpcb_stat_byvers objp;
+xdr_rpcb_stat_byvers(XDR *xdrs, rpcb_stat_byvers objp)
{
if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index 8203bd9..38cbb79 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -97,8 +97,7 @@ static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock);
* Activate a transport handle.
*/
void
-xprt_register(xprt)
- SVCXPRT *xprt;
+xprt_register(SVCXPRT *xprt)
{
int sock;
@@ -140,9 +139,7 @@ __xprt_unregister_unlocked(SVCXPRT *xprt)
* De-activate a transport handle.
*/
static void
-__xprt_do_unregister(xprt, dolock)
- SVCXPRT *xprt;
- bool_t dolock;
+__xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
{
int sock;
@@ -171,12 +168,9 @@ __xprt_do_unregister(xprt, dolock)
* program number comes in.
*/
bool_t
-svc_reg(xprt, prog, vers, dispatch, nconf)
- SVCXPRT *xprt;
- const rpcprog_t prog;
- const rpcvers_t vers;
- void (*dispatch)(struct svc_req *, SVCXPRT *);
- const struct netconfig *nconf;
+svc_reg(SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers,
+ void (*dispatch)(struct svc_req *, SVCXPRT *),
+ const struct netconfig *nconf)
{
bool_t dummy;
struct svc_callout *prev;
@@ -245,9 +239,7 @@ rpcb_it:
* Remove a service program from the callout list.
*/
void
-svc_unreg(prog, vers)
- const rpcprog_t prog;
- const rpcvers_t vers;
+svc_unreg(const rpcprog_t prog, const rpcvers_t vers)
{
struct svc_callout *prev;
struct svc_callout *s;
@@ -278,12 +270,9 @@ svc_unreg(prog, vers)
* program number comes in.
*/
bool_t
-svc_register(xprt, prog, vers, dispatch, protocol)
- SVCXPRT *xprt;
- u_long prog;
- u_long vers;
- void (*dispatch)(struct svc_req *, SVCXPRT *);
- int protocol;
+svc_register(SVCXPRT *xprt, u_long prog, u_long vers,
+ void (*dispatch)(struct svc_req *, SVCXPRT *),
+ int protocol)
{
struct svc_callout *prev;
struct svc_callout *s;
@@ -318,9 +307,7 @@ pmap_it:
* Remove a service program from the callout list.
*/
void
-svc_unregister(prog, vers)
- u_long prog;
- u_long vers;
+svc_unregister(u_long prog, u_long vers)
{
struct svc_callout *prev;
struct svc_callout *s;
@@ -345,11 +332,8 @@ svc_unregister(prog, vers)
* struct.
*/
static struct svc_callout *
-svc_find(prog, vers, prev, netid)
- rpcprog_t prog;
- rpcvers_t vers;
- struct svc_callout **prev;
- char *netid;
+svc_find(rpcprog_t prog, rpcvers_t vers, struct svc_callout **prev,
+ char *netid)
{
struct svc_callout *s, *p;
@@ -373,10 +357,8 @@ svc_find(prog, vers, prev, netid)
* Send a reply to an rpc request
*/
bool_t
-svc_sendreply(xprt, xdr_results, xdr_location)
- SVCXPRT *xprt;
- xdrproc_t xdr_results;
- void * xdr_location;
+svc_sendreply(SVCXPRT *xprt, xdrproc_t xdr_results,
+ void * xdr_location)
{
struct rpc_msg rply;
@@ -395,8 +377,7 @@ svc_sendreply(xprt, xdr_results, xdr_location)
* No procedure error reply
*/
void
-svcerr_noproc(xprt)
- SVCXPRT *xprt;
+svcerr_noproc(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -413,8 +394,7 @@ svcerr_noproc(xprt)
* Can't decode args error reply
*/
void
-svcerr_decode(xprt)
- SVCXPRT *xprt;
+svcerr_decode(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -431,8 +411,7 @@ svcerr_decode(xprt)
* Some system error
*/
void
-svcerr_systemerr(xprt)
- SVCXPRT *xprt;
+svcerr_systemerr(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -453,31 +432,27 @@ svcerr_systemerr(xprt)
* protocol: the portmapper (or rpc binder).
*/
void
-__svc_versquiet_on(xprt)
- SVCXPRT *xprt;
+__svc_versquiet_on(SVCXPRT *xprt)
{
SVC_EXT(xprt)->xp_flags |= SVC_VERSQUIET;
}
void
-__svc_versquiet_off(xprt)
- SVCXPRT *xprt;
+__svc_versquiet_off(SVCXPRT *xprt)
{
SVC_EXT(xprt)->xp_flags &= ~SVC_VERSQUIET;
}
void
-svc_versquiet(xprt)
- SVCXPRT *xprt;
+svc_versquiet(SVCXPRT *xprt)
{
__svc_versquiet_on(xprt);
}
int
-__svc_versquiet_get(xprt)
- SVCXPRT *xprt;
+__svc_versquiet_get(SVCXPRT *xprt)
{
return (SVC_EXT(xprt)->xp_flags & SVC_VERSQUIET);
@@ -488,9 +463,7 @@ __svc_versquiet_get(xprt)
* Authentication error reply
*/
void
-svcerr_auth(xprt, why)
- SVCXPRT *xprt;
- enum auth_stat why;
+svcerr_auth(SVCXPRT *xprt, enum auth_stat why)
{
struct rpc_msg rply;
@@ -507,8 +480,7 @@ svcerr_auth(xprt, why)
* Auth too weak error reply
*/
void
-svcerr_weakauth(xprt)
- SVCXPRT *xprt;
+svcerr_weakauth(SVCXPRT *xprt)
{
assert(xprt != NULL);
@@ -520,8 +492,7 @@ svcerr_weakauth(xprt)
* Program unavailable error reply
*/
void
-svcerr_noprog(xprt)
- SVCXPRT *xprt;
+svcerr_noprog(SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -538,10 +509,7 @@ svcerr_noprog(xprt)
* Program version mismatch error reply
*/
void
-svcerr_progvers(xprt, low_vers, high_vers)
- SVCXPRT *xprt;
- rpcvers_t low_vers;
- rpcvers_t high_vers;
+svcerr_progvers(SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers)
{
struct rpc_msg rply;
@@ -563,7 +531,7 @@ svcerr_progvers(xprt, low_vers, high_vers)
* parameters.
*/
SVCXPRT *
-svc_xprt_alloc()
+svc_xprt_alloc(void)
{
SVCXPRT *xprt;
SVCXPRT_EXT *ext;
@@ -588,8 +556,7 @@ svc_xprt_alloc()
* Free a server transport structure.
*/
void
-svc_xprt_free(xprt)
- SVCXPRT *xprt;
+svc_xprt_free(SVCXPRT *xprt)
{
mem_free(xprt->xp_p3, sizeof(SVCXPRT_EXT));
@@ -615,8 +582,7 @@ svc_xprt_free(xprt)
*/
void
-svc_getreq(rdfds)
- int rdfds;
+svc_getreq(int rdfds)
{
fd_set readfds;
@@ -626,8 +592,7 @@ svc_getreq(rdfds)
}
void
-svc_getreqset(readfds)
- fd_set *readfds;
+svc_getreqset(fd_set *readfds)
{
int bit, fd;
fd_mask mask, *maskp;
@@ -647,8 +612,7 @@ svc_getreqset(readfds)
}
void
-svc_getreq_common(fd)
- int fd;
+svc_getreq_common(int fd)
{
SVCXPRT *xprt;
struct svc_req r;
@@ -743,9 +707,7 @@ call_done:
void
-svc_getreq_poll(pfdp, pollretval)
- struct pollfd *pfdp;
- int pollretval;
+svc_getreq_poll(struct pollfd *pfdp, int pollretval)
{
int i;
int fds_found;
diff --git a/lib/libc/rpc/svc_auth.c b/lib/libc/rpc/svc_auth.c
index 6fe5bec..58435af 100644
--- a/lib/libc/rpc/svc_auth.c
+++ b/lib/libc/rpc/svc_auth.c
@@ -95,9 +95,7 @@ struct svc_auth_ops svc_auth_null_ops;
* invalid.
*/
enum auth_stat
-_authenticate(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_authenticate(struct svc_req *rqst, struct rpc_msg *msg)
{
int cred_flavor;
struct authsvc *asp;
diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c
index 7e837d3..8e51183 100644
--- a/lib/libc/rpc/svc_auth_unix.c
+++ b/lib/libc/rpc/svc_auth_unix.c
@@ -56,9 +56,7 @@ __FBSDID("$FreeBSD$");
* Unix longhand authenticator
*/
enum auth_stat
-_svcauth_unix(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg)
{
enum auth_stat stat;
XDR xdrs;
@@ -147,9 +145,7 @@ done:
*/
/*ARGSUSED*/
enum auth_stat
-_svcauth_short(rqst, msg)
- struct svc_req *rqst;
- struct rpc_msg *msg;
+_svcauth_short(struct svc_req *rqst, struct rpc_msg *msg)
{
return (AUTH_REJECTEDCRED);
}
diff --git a/lib/libc/rpc/svc_generic.c b/lib/libc/rpc/svc_generic.c
index 21569c0..d3db612 100644
--- a/lib/libc/rpc/svc_generic.c
+++ b/lib/libc/rpc/svc_generic.c
@@ -72,13 +72,14 @@ extern int __svc_vc_setflag(SVCXPRT *, int);
* It creates a link list of all the handles it could create.
* If svc_create() is called multiple times, it uses the handle
* created earlier instead of creating a new handle every time.
+ *
+ * prognum - Program number
+ * versnum - Version number
+ * nettype - Networktype token
*/
int
-svc_create(dispatch, prognum, versnum, nettype)
- void (*dispatch)(struct svc_req *, SVCXPRT *);
- rpcprog_t prognum; /* Program number */
- rpcvers_t versnum; /* Version number */
- const char *nettype; /* Networktype token */
+svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
+ rpcprog_t prognum, rpcvers_t versnum, const char *nettype)
{
struct xlist {
SVCXPRT *xprt; /* Server handle */
@@ -143,13 +144,14 @@ svc_create(dispatch, prognum, versnum, nettype)
* The high level interface to svc_tli_create().
* It tries to create a server for "nconf" and registers the service
* with the rpcbind. It calls svc_tli_create();
+ *
+ * prognum - Program number
+ * versnum - Version number
+ * ncofn - Netconfig structure for the network
*/
SVCXPRT *
-svc_tp_create(dispatch, prognum, versnum, nconf)
- void (*dispatch)(struct svc_req *, SVCXPRT *);
- rpcprog_t prognum; /* Program number */
- rpcvers_t versnum; /* Version number */
- const struct netconfig *nconf; /* Netconfig structure for the network */
+svc_tp_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
+ rpcprog_t prognum, rpcvers_t versnum, const struct netconfig *nconf)
{
SVCXPRT *xprt;
@@ -184,14 +186,16 @@ svc_tp_create(dispatch, prognum, versnum, nconf)
* is set to 8.
*
* If sendsz or recvsz are zero, their default values are chosen.
+ *
+ * fd - Connection end point
+ * nconf - Netconfig struct for nettoken
+ * bindaddr - Local bind address
+ * sendsz - Max sendsize
+ * recvxz - Max recvsize
*/
SVCXPRT *
-svc_tli_create(fd, nconf, bindaddr, sendsz, recvsz)
- int fd; /* Connection end point */
- const struct netconfig *nconf; /* Netconfig struct for nettoken */
- const struct t_bind *bindaddr; /* Local bind address */
- u_int sendsz; /* Max sendsize */
- u_int recvsz; /* Max recvsize */
+svc_tli_create(int fd, const struct netconfig *nconf,
+ const struct t_bind *bindaddr, u_int sendsz, u_int recvsz)
{
SVCXPRT *xprt = NULL; /* service handle */
bool_t madefd = FALSE; /* whether fd opened here */
diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c
index ffa9122..9159335 100644
--- a/lib/libc/rpc/svc_raw.c
+++ b/lib/libc/rpc/svc_raw.c
@@ -82,7 +82,7 @@ static bool_t svc_raw_control(SVCXPRT *, const u_int, void *);
char *__rpc_rawcombuf = NULL;
SVCXPRT *
-svc_raw_create()
+svc_raw_create(void)
{
struct svc_raw_private *srp;
/* VARIABLES PROTECTED BY svcraw_lock: svc_raw_private, srp */
@@ -125,17 +125,14 @@ svc_raw_create()
/*ARGSUSED*/
static enum xprt_stat
-svc_raw_stat(xprt)
-SVCXPRT *xprt; /* args needed to satisfy ANSI-C typechecking */
+svc_raw_stat(SVCXPRT *xprt)
{
return (XPRT_IDLE);
}
/*ARGSUSED*/
static bool_t
-svc_raw_recv(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svc_raw_recv(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svc_raw_private *srp;
XDR *xdrs;
@@ -159,9 +156,7 @@ svc_raw_recv(xprt, msg)
/*ARGSUSED*/
static bool_t
-svc_raw_reply(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+svc_raw_reply(SVCXPRT *xprt, struct rpc_msg *msg)
{
struct svc_raw_private *srp;
XDR *xdrs;
@@ -201,10 +196,7 @@ svc_raw_reply(xprt, msg)
/*ARGSUSED*/
static bool_t
-svc_raw_getargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- void *args_ptr;
+svc_raw_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr)
{
struct svc_raw_private *srp;
@@ -222,10 +214,7 @@ svc_raw_getargs(xprt, xdr_args, args_ptr)
/*ARGSUSED*/
static bool_t
-svc_raw_freeargs(xprt, xdr_args, args_ptr)
- SVCXPRT *xprt;
- xdrproc_t xdr_args;
- void *args_ptr;
+svc_raw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr)
{
struct svc_raw_private *srp;
XDR *xdrs;
@@ -245,24 +234,19 @@ svc_raw_freeargs(xprt, xdr_args, args_ptr)
/*ARGSUSED*/
static void
-svc_raw_destroy(xprt)
-SVCXPRT *xprt;
+svc_raw_destroy(SVCXPRT *xprt)
{
}
/*ARGSUSED*/
static bool_t
-svc_raw_control(xprt, rq, in)
- SVCXPRT *xprt;
- const u_int rq;
- void *in;
+svc_raw_control(SVCXPRT *xprt, const u_int rq, void *in)
{
return (FALSE);
}
static void
-svc_raw_ops(xprt)
- SVCXPRT *xprt;
+svc_raw_ops(SVCXPRT *xprt)
{
static struct xp_ops ops;
static struct xp_ops2 ops2;
diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c
index 08c8a84..9b0089b 100644
--- a/lib/libc/rpc/svc_run.c
+++ b/lib/libc/rpc/svc_run.c
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include "mt_misc.h"
void
-svc_run()
+svc_run(void)
{
fd_set readfds, cleanfds;
struct timeval timeout;
@@ -89,7 +89,7 @@ svc_run()
* more work to do.
*/
void
-svc_exit()
+svc_exit(void)
{
rwlock_wrlock(&svc_fd_lock);
FD_ZERO(&svc_fdset);
diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c
index b97f974..4713efc 100644
--- a/lib/libc/rpc/svc_simple.c
+++ b/lib/libc/rpc/svc_simple.c
@@ -92,16 +92,18 @@ static const char __no_mem_str[] = "out of memory";
* is also limited by the recvsize for that transport, even if it is
* a COTS transport. This may be wrong, but for cases like these, they
* should not use the simplified interfaces like this.
+ *
+ * prognum - program number
+ * versnum - version number
+ * procnum - procedure number
+ * progname - Server routine
+ * inproc, outproc - in/out XDR procedures
+ * nettype - nettype
*/
-
int
-rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
- rpcprog_t prognum; /* program number */
- rpcvers_t versnum; /* version number */
- rpcproc_t procnum; /* procedure number */
- char *(*progname)(char *); /* Server routine */
- xdrproc_t inproc, outproc; /* in/out XDR procedures */
- char *nettype; /* nettype */
+rpc_reg(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
+ char *(*progname)(char *), xdrproc_t inproc, xdrproc_t outproc,
+ char *nettype)
{
struct netconfig *nconf;
int done = FALSE;
@@ -242,9 +244,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
*/
static void
-universal(rqstp, transp)
- struct svc_req *rqstp;
- SVCXPRT *transp;
+universal(struct svc_req *rqstp, SVCXPRT *transp)
{
rpcprog_t prog;
rpcvers_t vers;
diff --git a/lib/libc/sparc64/gen/_set_tp.c b/lib/libc/sparc64/gen/_set_tp.c
index cf9db26..7632951 100644
--- a/lib/libc/sparc64/gen/_set_tp.c
+++ b/lib/libc/sparc64/gen/_set_tp.c
@@ -25,6 +25,7 @@
*
* $FreeBSD$
*/
+#include "libc_private.h"
void
_set_tp(void *tpval)
diff --git a/lib/libc/stdio/_flock_stub.c b/lib/libc/stdio/_flock_stub.c
index 0b61315..f53df35 100644
--- a/lib/libc/stdio/_flock_stub.c
+++ b/lib/libc/stdio/_flock_stub.c
@@ -55,6 +55,9 @@ __weak_reference(_flockfile_debug_stub, _flockfile_debug);
__weak_reference(_ftrylockfile, ftrylockfile);
__weak_reference(_funlockfile, funlockfile);
+void _flockfile_debug_stub(FILE *, char *, int);
+int _ftrylockfile(FILE *);
+
void
_flockfile(FILE *fp)
{
diff --git a/lib/libc/stdio/fgetwln.c b/lib/libc/stdio/fgetwln.c
index 6d9087b..8439496 100644
--- a/lib/libc/stdio/fgetwln.c
+++ b/lib/libc/stdio/fgetwln.c
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
#include "local.h"
#include "xlocale_private.h"
+wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t);
+
wchar_t *
fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t locale)
{
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c
index be196b7..0eabe82 100644
--- a/lib/libc/stdio/findfp.c
+++ b/lib/libc/stdio/findfp.c
@@ -113,7 +113,7 @@ moreglue(int n)
* Find a free FILE for fopen et al.
*/
FILE *
-__sfp()
+__sfp(void)
{
FILE *fp;
int n;
@@ -164,6 +164,7 @@ found:
*/
__warn_references(f_prealloc,
"warning: this program uses f_prealloc(), which is not recommended.");
+void f_prealloc(void);
void
f_prealloc(void)
@@ -195,7 +196,7 @@ f_prealloc(void)
* The name `_cleanup' is, alas, fairly well known outside stdio.
*/
void
-_cleanup()
+_cleanup(void)
{
/* (void) _fwalk(fclose); */
(void) _fwalk(__sflush); /* `cheating' */
@@ -205,7 +206,7 @@ _cleanup()
* __sinit() is called whenever stdio's internal variables must be set up.
*/
void
-__sinit()
+__sinit(void)
{
/* Make sure we clean up on exit. */
diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c
index 21040bc..2815072 100644
--- a/lib/libc/stdio/getchar.c
+++ b/lib/libc/stdio/getchar.c
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
#undef getchar_unlocked
int
-getchar()
+getchar(void)
{
int retval;
FLOCKFILE(stdin);
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 50f0690..b537263 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -814,9 +814,7 @@ match_failure:
* considered part of the scanset.
*/
static const u_char *
-__sccl(tab, fmt)
- char *tab;
- const u_char *fmt;
+__sccl(char *tab, const u_char *fmt)
{
int c, n, v, i;
struct xlocale_collate *table =
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index 022c6aa..2335c40 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
void
-abort()
+abort(void)
{
struct sigaction act;
diff --git a/lib/libc/stdlib/abs.c b/lib/libc/stdlib/abs.c
index 8758947..367b114 100644
--- a/lib/libc/stdlib/abs.c
+++ b/lib/libc/stdlib/abs.c
@@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
int
-abs(j)
- int j;
+abs(int j)
{
return(j < 0 ? -j : j);
}
diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c
index 0a5048a..eda5703 100644
--- a/lib/libc/stdlib/atexit.c
+++ b/lib/libc/stdlib/atexit.c
@@ -82,6 +82,9 @@ struct atexit {
static struct atexit *__atexit; /* points to head of LIFO stack */
typedef DECLARE_BLOCK(void, atexit_block, void);
+int atexit_b(atexit_block);
+int __cxa_atexit(void (*)(void *), void *, void *);
+
/*
* Register the function described by 'fptr' to be called at application
* exit or owning shared object unload time. This is a helper function
diff --git a/lib/libc/stdlib/atof.c b/lib/libc/stdlib/atof.c
index 3514ae3..0458eb9 100644
--- a/lib/libc/stdlib/atof.c
+++ b/lib/libc/stdlib/atof.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
double
-atof(ascii)
- const char *ascii;
+atof(const char *ascii)
{
return strtod(ascii, (char **)NULL);
}
double
-atof_l(ascii, locale)
- const char *ascii;
- locale_t locale;
+atof_l(const char *ascii, locale_t locale)
{
return strtod_l(ascii, (char **)NULL, locale);
}
diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c
index 564273e..9f92fcd 100644
--- a/lib/libc/stdlib/atoi.c
+++ b/lib/libc/stdlib/atoi.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
int
-atoi(str)
- const char *str;
+atoi(const char *str)
{
return (int)strtol(str, (char **)NULL, 10);
}
int
-atoi_l(str, locale)
- const char *str;
- locale_t locale;
+atoi_l(const char *str, locale_t locale)
{
return (int)strtol_l(str, (char **)NULL, 10, locale);
}
diff --git a/lib/libc/stdlib/atol.c b/lib/libc/stdlib/atol.c
index d30aa18..bd8ef07 100644
--- a/lib/libc/stdlib/atol.c
+++ b/lib/libc/stdlib/atol.c
@@ -42,16 +42,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
long
-atol(str)
- const char *str;
+atol(const char *str)
{
return strtol(str, (char **)NULL, 10);
}
long
-atol_l(str, locale)
- const char *str;
- locale_t locale;
+atol_l(const char *str, locale_t locale)
{
return strtol_l(str, (char **)NULL, 10, locale);
}
diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c
index af52838..093fde5 100644
--- a/lib/libc/stdlib/atoll.c
+++ b/lib/libc/stdlib/atoll.c
@@ -39,16 +39,13 @@ __FBSDID("$FreeBSD$");
#include <xlocale.h>
long long
-atoll(str)
- const char *str;
+atoll(const char *str)
{
return strtoll(str, (char **)NULL, 10);
}
long long
-atoll_l(str, locale)
- const char *str;
- locale_t locale;
+atoll_l(const char *str, locale_t locale)
{
return strtoll_l(str, (char **)NULL, 10, locale);
}
diff --git a/lib/libc/stdlib/bsearch.c b/lib/libc/stdlib/bsearch.c
index 4a1dd52..8303f97 100644
--- a/lib/libc/stdlib/bsearch.c
+++ b/lib/libc/stdlib/bsearch.c
@@ -61,20 +61,12 @@ __FBSDID("$FreeBSD$");
*/
#ifdef I_AM_BSEARCH_B
void *
-bsearch_b(key, base0, nmemb, size, compar)
- const void *key;
- const void *base0;
- size_t nmemb;
- size_t size;
- DECLARE_BLOCK(int, compar, const void *, const void *);
+bsearch_b(const void *key, const void *base0, size_t nmemb, size_t size,
+ DECLARE_BLOCK(int, compar, const void *, const void *))
#else
void *
-bsearch(key, base0, nmemb, size, compar)
- const void *key;
- const void *base0;
- size_t nmemb;
- size_t size;
- int (*compar)(const void *, const void *);
+bsearch(const void *key, const void *base0, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *))
#endif
{
const char *base = base0;
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index 145eb9d..a656e04 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -56,8 +56,7 @@ int __isthreaded = 0;
* Exit, flushing stdio buffers if necessary.
*/
void
-exit(status)
- int status;
+exit(int status)
{
/* Ensure that the auto-initialization routine is linked in: */
extern int _thread_autoinit_dummy_decl;
diff --git a/lib/libc/stdlib/heapsort.c b/lib/libc/stdlib/heapsort.c
index 673a6a1..a7a4a26 100644
--- a/lib/libc/stdlib/heapsort.c
+++ b/lib/libc/stdlib/heapsort.c
@@ -138,6 +138,12 @@ typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *);
} \
}
+#ifdef I_AM_HEAPSORT_B
+int heapsort_b(void *, size_t, size_t, heapsort_block);
+#else
+int heapsort(void *, size_t, size_t,
+ int (*)(const void *, const void *));
+#endif
/*
* Heapsort -- Knuth, Vol. 3, page 145. Runs in O (N lg N), both average
* and worst. While heapsort is faster than the worst case of quicksort,
@@ -147,16 +153,11 @@ typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *);
*/
#ifdef I_AM_HEAPSORT_B
int
-heapsort_b(vbase, nmemb, size, compar)
- void *vbase;
- size_t nmemb, size;
- heapsort_block compar;
+heapsort_b(void *vbase, size_t nmemb, size_t size, heapsort_block compar)
#else
int
-heapsort(vbase, nmemb, size, compar)
- void *vbase;
- size_t nmemb, size;
- int (*compar)(const void *, const void *);
+heapsort(void *vbase, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *))
#endif
{
size_t cnt, i, j, l;
diff --git a/lib/libc/stdlib/labs.c b/lib/libc/stdlib/labs.c
index 816370e..ef06882 100644
--- a/lib/libc/stdlib/labs.c
+++ b/lib/libc/stdlib/labs.c
@@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
long
-labs(j)
- long j;
+labs(long j)
{
return(j < 0 ? -j : j);
}
diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c
index 6b368c3..55b3a0c 100644
--- a/lib/libc/stdlib/merge.c
+++ b/lib/libc/stdlib/merge.c
@@ -99,19 +99,21 @@ static void insertionsort(u_char *, size_t, size_t, cmp_t);
((u_char *)0 + \
(((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1)))
+#ifdef I_AM_MERGESORT_B
+int mergesort_b(void *, size_t, size_t, cmp_t);
+#else
+int mergesort(void *, size_t, size_t, cmp_t);
+#endif
+
/*
* Arguments are as for qsort.
*/
int
#ifdef I_AM_MERGESORT_B
-mergesort_b(base, nmemb, size, cmp)
+mergesort_b(void *base, size_t nmemb, size_t size, cmp_t cmp)
#else
-mergesort(base, nmemb, size, cmp)
+mergesort(void *base, size_t nmemb, size_t size, cmp_t cmp)
#endif
- void *base;
- size_t nmemb;
- size_t size;
- cmp_t cmp;
{
size_t i;
int sense;
@@ -271,10 +273,7 @@ COPY: b = t;
* is defined. Otherwise simple pairwise merging is used.)
*/
void
-setup(list1, list2, n, size, cmp)
- size_t n, size;
- u_char *list1, *list2;
- cmp_t cmp;
+setup(u_char *list1, u_char *list2, size_t n, size_t size, cmp_t cmp)
{
int i, length, size2, tmp, sense;
u_char *f1, *f2, *s, *l2, *last, *p2;
@@ -345,10 +344,7 @@ setup(list1, list2, n, size, cmp)
* last 4 elements.
*/
static void
-insertionsort(a, n, size, cmp)
- u_char *a;
- size_t n, size;
- cmp_t cmp;
+insertionsort(u_char *a, size_t n, size_t size, cmp_t cmp)
{
u_char *ai, *s, *t, *u, tmp;
int i;
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index e97ea92..0881688 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -64,9 +64,7 @@ static inline void swapfunc(char *, char *, int, int, int);
es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1;
static inline void
-swapfunc(a, b, n, swaptype_long, swaptype_int)
- char *a, *b;
- int n, swaptype_long, swaptype_int;
+swapfunc( char *a, char *b, int n, int swaptype_long, int swaptype_int)
{
if (swaptype_long <= 1)
swapcode(long, a, b, n)
diff --git a/lib/libc/stdlib/radixsort.c b/lib/libc/stdlib/radixsort.c
index 8310e6d..205f776 100644
--- a/lib/libc/stdlib/radixsort.c
+++ b/lib/libc/stdlib/radixsort.c
@@ -88,10 +88,7 @@ static void r_sort_b(const u_char **, const u_char **, int, int,
}
int
-radixsort(a, n, tab, endch)
- const u_char **a, *tab;
- int n;
- u_int endch;
+radixsort(const u_char **a, int n, const u_char *tab, u_int endch)
{
const u_char *tr;
int c;
@@ -103,10 +100,7 @@ radixsort(a, n, tab, endch)
}
int
-sradixsort(a, n, tab, endch)
- const u_char **a, *tab;
- int n;
- u_int endch;
+sradixsort(const u_char **a, int n, const u_char *tab, u_int endch)
{
const u_char *tr, **ta;
int c;
@@ -131,11 +125,7 @@ sradixsort(a, n, tab, endch)
/* Unstable, in-place sort. */
static void
-r_sort_a(a, n, i, tr, endch)
- const u_char **a;
- int n, i;
- const u_char *tr;
- u_int endch;
+r_sort_a(const u_char **a, int n, int i, const u_char *tr, u_int endch)
{
static int count[256], nc, bmin;
int c;
@@ -233,11 +223,8 @@ r_sort_a(a, n, i, tr, endch)
/* Stable sort, requiring additional memory. */
static void
-r_sort_b(a, ta, n, i, tr, endch)
- const u_char **a, **ta;
- int n, i;
- const u_char *tr;
- u_int endch;
+r_sort_b(const u_char **a, const u_char **ta, int n, int i, const u_char *tr,
+ u_int endch)
{
static int count[256], nc, bmin;
int c;
@@ -304,12 +291,9 @@ r_sort_b(a, ta, n, i, tr, endch)
}
}
+/* insertion sort */
static inline void
-simplesort(a, n, b, tr, endch) /* insertion sort */
- const u_char **a;
- int n, b;
- const u_char *tr;
- u_int endch;
+simplesort(const u_char **a, int n, int b, const u_char *tr, u_int endch)
{
u_char ch;
const u_char **ak, **ai, *s, *t;
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 4f4aa8d..b8871a2 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -111,14 +111,13 @@ static u_long next =
#endif
int
-rand()
+rand(void)
{
return (do_rand(&next));
}
void
-srand(seed)
-u_int seed;
+srand(u_int seed)
{
next = seed;
#ifndef USE_WEAK_SEEDING
@@ -136,7 +135,7 @@ u_int seed;
* data from the kernel.
*/
void
-sranddev()
+sranddev(void)
{
int mib[2];
size_t len;
diff --git a/lib/libc/stdlib/tfind.c b/lib/libc/stdlib/tfind.c
index c5d66cf..0ad391e 100644
--- a/lib/libc/stdlib/tfind.c
+++ b/lib/libc/stdlib/tfind.c
@@ -23,12 +23,15 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <search.h>
-/* find a node, or return 0 */
+/*
+ * find a node, or return 0
+ *
+ * vkey - key to be found
+ * vrootp - address of the tree root
+ */
void *
-tfind(vkey, vrootp, compar)
- const void *vkey; /* key to be found */
- void * const *vrootp; /* address of the tree root */
- int (*compar)(const void *, const void *);
+tfind(const void *vkey, void * const *vrootp,
+ int (*compar)(const void *, const void *))
{
node_t **rootp = (node_t **)vrootp;
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 8981011..838ebdd 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -127,13 +127,8 @@ strftime(char * __restrict s, size_t maxsize, const char * __restrict format,
}
static char *
-_fmt(format, t, pt, ptlim, warnp, loc)
-const char * format;
-const struct tm * const t;
-char * pt;
-const char * const ptlim;
-int * warnp;
-locale_t loc;
+_fmt(const char *format, const struct tm * const t, char *pt,
+ const char * const ptlim, int *warnp, locale_t loc)
{
int Ealternative, Oalternative, PadIndex;
struct lc_time_T *tptr = __get_current_time_locale(loc);
@@ -592,12 +587,8 @@ label:
}
static char *
-_conv(n, format, pt, ptlim, loc)
-const int n;
-const char * const format;
-char * const pt;
-const char * const ptlim;
-locale_t loc;
+_conv(const int n, const char * const format, char * const pt,
+ const char * const ptlim, locale_t loc)
{
char buf[INT_STRLEN_MAXIMUM(int) + 1];
@@ -606,10 +597,7 @@ locale_t loc;
}
static char *
-_add(str, pt, ptlim)
-const char * str;
-char * pt;
-const char * const ptlim;
+_add(const char *str, char *pt, const char * const ptlim)
{
while (pt < ptlim && (*pt = *str++) != '\0')
++pt;
@@ -625,14 +613,8 @@ const char * const ptlim;
*/
static char *
-_yconv(a, b, convert_top, convert_yy, pt, ptlim, loc)
-const int a;
-const int b;
-const int convert_top;
-const int convert_yy;
-char * pt;
-const char * const ptlim;
-locale_t loc;
+_yconv(const int a, const int b, const int convert_top, const int convert_yy,
+ char *pt, const char * const ptlim, locale_t loc)
{
register int lead;
register int trail;
diff --git a/lib/libc/string/strchrnul.c b/lib/libc/string/strchrnul.c
index 98e652d..893468c 100644
--- a/lib/libc/string/strchrnul.c
+++ b/lib/libc/string/strchrnul.c
@@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$");
__weak_reference(__strchrnul, strchrnul);
+char *__strchrnul(const char *, int);
+
char *
__strchrnul(const char *p, int ch)
{
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index fad970c..e4fe1b2 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -90,8 +90,6 @@ ASM+=$(_asm)
.endif
.endfor
-OBJS+= ${ASM} ${PSEUDO}
-
SASM= ${ASM:S/.o/.S/}
SPSEUDO= ${PSEUDO:S/.o/.S/}
@@ -104,7 +102,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map
CLEANFILES+= ${SASM} ${SPSEUDO}
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
- ${MACHINE_CPUARCH} == "powerpc"
+ ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
.else
NOTE_GNU_STACK=''
diff --git a/lib/libc/sys/__error.c b/lib/libc/sys/__error.c
index 28cc31d..8a065bf7 100644
--- a/lib/libc/sys/__error.c
+++ b/lib/libc/sys/__error.c
@@ -30,6 +30,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "libc_private.h"
+
extern int errno;
static int *
diff --git a/lib/libc/sys/close.c b/lib/libc/sys/close.c
index 02e74c6..f7b36f8 100644
--- a/lib/libc/sys/close.c
+++ b/lib/libc/sys/close.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/fcntl.h>
+#include <unistd.h>
#include "libc_private.h"
__weak_reference(__sys_close, __close);
diff --git a/lib/libc/sys/fsync.c b/lib/libc/sys/fsync.c
index 3fff428..5f15129 100644
--- a/lib/libc/sys/fsync.c
+++ b/lib/libc/sys/fsync.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/fcntl.h>
+#include <unistd.h>
#include "libc_private.h"
__weak_reference(__sys_fsync, __fsync);
diff --git a/lib/libc/sys/msync.c b/lib/libc/sys/msync.c
index 3c6879f..d86cc04 100644
--- a/lib/libc/sys/msync.c
+++ b/lib/libc/sys/msync.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/fcntl.h>
+#include <sys/mman.h>
#include "libc_private.h"
__weak_reference(__sys_msync, __msync);
diff --git a/lib/libc/sys/readv.c b/lib/libc/sys/readv.c
index 8c82040..5672927 100644
--- a/lib/libc/sys/readv.c
+++ b/lib/libc/sys/readv.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/syscall.h>
+#include <sys/uio.h>
#include <unistd.h>
#include "libc_private.h"
diff --git a/lib/libc/sys/reboot.2 b/lib/libc/sys/reboot.2
index caaba58..df4a0ec 100644
--- a/lib/libc/sys/reboot.2
+++ b/lib/libc/sys/reboot.2
@@ -28,7 +28,7 @@
.\" @(#)reboot.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd September 18, 2015
.Dt REBOOT 2
.Os
.Sh NAME
@@ -113,6 +113,13 @@ Normally, the disks are sync'd (see
before the processor is halted or rebooted.
This option may be useful if file system changes have been made manually
or if the processor is on fire.
+.It Dv RB_REROOT
+Instead of rebooting, unmount all filesystems except the one containing
+currently-running executable, and mount root filesystem using the same
+mechanism which is used during normal boot, based on
+vfs.root.mountfrom
+.Xr kenv 8
+variable.
.It Dv RB_RDONLY
Initially mount the root file system read-only.
This is currently the default, and this option has been deprecated.
@@ -159,8 +166,3 @@ The
.Fn reboot
system call appeared in
.Bx 4.0 .
-.Sh BUGS
-The HP300 implementation supports neither
-.Dv RB_DFLTROOT
-nor
-.Dv RB_KDB .
diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2
index 4c7d5ad..54d89bc 100644
--- a/lib/libc/sys/setuid.2
+++ b/lib/libc/sys/setuid.2
@@ -28,7 +28,7 @@
.\" @(#)setuid.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd September 13, 2015
.Dt SETUID 2
.Os
.Sh NAME
@@ -178,15 +178,10 @@ pseudocode(void)
int fd;
/* ... */
- fd = open("/path/to/sensitive/data", O_RDWR);
+ fd = open("/path/to/sensitive/data", O_RDWR | O_CLOEXEC);
if (fd == -1)
err(1, "open");
- /*
- * Set close-on-exec flag; see fcntl(2) for more information.
- */
- if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
- err(1, "fcntl(F_SETFD)");
/* ... */
execve(path, argv, environ);
}
diff --git a/lib/libc/sys/writev.c b/lib/libc/sys/writev.c
index 6be74b3..20b1005 100644
--- a/lib/libc/sys/writev.c
+++ b/lib/libc/sys/writev.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/syscall.h>
+#include <sys/uio.h>
#include <unistd.h>
#include "libc_private.h"
diff --git a/lib/libc/tests/gen/posix_spawn/Makefile b/lib/libc/tests/gen/posix_spawn/Makefile
index d2dfa54..f20bbd7 100644
--- a/lib/libc/tests/gen/posix_spawn/Makefile
+++ b/lib/libc/tests/gen/posix_spawn/Makefile
@@ -21,6 +21,8 @@ PROGS+= h_spawnattr
SCRIPTS= h_nonexec
SCRIPTS+= h_zero
+CLEANFILES+= h_nonexec
+
.include "../../Makefile.netbsd-tests"
h_zero:
diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c
index d137780..9555173 100644
--- a/lib/libc/tests/stdio/fmemopen2_test.c
+++ b/lib/libc/tests/stdio/fmemopen2_test.c
@@ -97,6 +97,7 @@ ATF_TC_BODY(test_preexisting, tc)
/* Close the FILE *. */
rc = fclose(fp);
+ ATF_REQUIRE(rc == 0);
/* Check that the string was not modified after the first 4 bytes. */
ATF_REQUIRE(strcmp(str, str3) == 0);
diff --git a/lib/libc/xdr/xdr_float.c b/lib/libc/xdr/xdr_float.c
index fc024fc..63ecd03 100644
--- a/lib/libc/xdr/xdr_float.c
+++ b/lib/libc/xdr/xdr_float.c
@@ -102,9 +102,7 @@ static struct sgl_limits {
#endif /* vax */
bool_t
-xdr_float(xdrs, fp)
- XDR *xdrs;
- float *fp;
+xdr_float(XDR *xdrs, float *fp)
{
#ifndef IEEEFP
struct ieee_single is;
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index 5e21883..22c9f89 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -230,7 +230,7 @@ SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
.endif
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
- ${MACHINE_CPUARCH} == "powerpc"
+ ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
AFLAGS+=--noexecstack
ACFLAGS+=-Wa,--noexecstack
.endif
diff --git a/lib/libcrypt/tests/Makefile.depend b/lib/libcrypt/tests/Makefile.depend
index d0caca1..dd2539c 100644
--- a/lib/libcrypt/tests/Makefile.depend
+++ b/lib/libcrypt/tests/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libcuse/Makefile.depend b/lib/libcuse/Makefile.depend
index 441e1ee..0a2f351 100644
--- a/lib/libcuse/Makefile.depend
+++ b/lib/libcuse/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libcxxrt/Makefile.depend.host b/lib/libcxxrt/Makefile.depend.host
index 9f46a2f..971c379 100644
--- a/lib/libcxxrt/Makefile.depend.host
+++ b/lib/libcxxrt/Makefile.depend.host
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
usr.bin/clang/clang \
diff --git a/lib/libevent/Makefile.depend b/lib/libevent/Makefile.depend
index ccd19e5..18be76b 100644
--- a/lib/libevent/Makefile.depend
+++ b/lib/libevent/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
include/xlocale \
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 3095e06..ae8b79d 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -495,7 +495,8 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len)
hints.ai_protocol = 0;
hints.ai_flags = AI_NUMERICHOST;
/* port is not relevant for this purpose */
- getaddrinfo(host, "443", &hints, &res);
+ if (getaddrinfo(host, "443", &hints, &res) != 0)
+ res = NULL;
free(host);
return res;
}
diff --git a/lib/libgpib/Makefile.depend b/lib/libgpib/Makefile.depend
index 4370d1e..3699b06 100644
--- a/lib/libgpib/Makefile.depend
+++ b/lib/libgpib/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/BIG5/Makefile.depend b/lib/libiconv_modules/BIG5/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/BIG5/Makefile.depend
+++ b/lib/libiconv_modules/BIG5/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/DECHanyu/Makefile.depend b/lib/libiconv_modules/DECHanyu/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/DECHanyu/Makefile.depend
+++ b/lib/libiconv_modules/DECHanyu/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/EUC/Makefile.depend b/lib/libiconv_modules/EUC/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/EUC/Makefile.depend
+++ b/lib/libiconv_modules/EUC/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/EUCTW/Makefile.depend b/lib/libiconv_modules/EUCTW/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/EUCTW/Makefile.depend
+++ b/lib/libiconv_modules/EUCTW/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/GBK2K/Makefile.depend b/lib/libiconv_modules/GBK2K/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/GBK2K/Makefile.depend
+++ b/lib/libiconv_modules/GBK2K/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/HZ/Makefile.depend b/lib/libiconv_modules/HZ/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/HZ/Makefile.depend
+++ b/lib/libiconv_modules/HZ/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/ISO2022/Makefile.depend b/lib/libiconv_modules/ISO2022/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/ISO2022/Makefile.depend
+++ b/lib/libiconv_modules/ISO2022/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/JOHAB/Makefile.depend b/lib/libiconv_modules/JOHAB/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/JOHAB/Makefile.depend
+++ b/lib/libiconv_modules/JOHAB/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/MSKanji/Makefile.depend b/lib/libiconv_modules/MSKanji/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/MSKanji/Makefile.depend
+++ b/lib/libiconv_modules/MSKanji/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/UES/Makefile.depend b/lib/libiconv_modules/UES/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/UES/Makefile.depend
+++ b/lib/libiconv_modules/UES/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/UTF1632/Makefile.depend b/lib/libiconv_modules/UTF1632/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/UTF1632/Makefile.depend
+++ b/lib/libiconv_modules/UTF1632/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/UTF7/Makefile.depend b/lib/libiconv_modules/UTF7/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/UTF7/Makefile.depend
+++ b/lib/libiconv_modules/UTF7/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/UTF8/Makefile.depend b/lib/libiconv_modules/UTF8/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/UTF8/Makefile.depend
+++ b/lib/libiconv_modules/UTF8/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/VIQR/Makefile.depend b/lib/libiconv_modules/VIQR/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/VIQR/Makefile.depend
+++ b/lib/libiconv_modules/VIQR/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/ZW/Makefile.depend b/lib/libiconv_modules/ZW/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/ZW/Makefile.depend
+++ b/lib/libiconv_modules/ZW/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/iconv_none/Makefile.depend b/lib/libiconv_modules/iconv_none/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/iconv_none/Makefile.depend
+++ b/lib/libiconv_modules/iconv_none/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/iconv_std/Makefile.depend b/lib/libiconv_modules/iconv_std/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/iconv_std/Makefile.depend
+++ b/lib/libiconv_modules/iconv_std/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_646/Makefile.depend b/lib/libiconv_modules/mapper_646/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_646/Makefile.depend
+++ b/lib/libiconv_modules/mapper_646/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_none/Makefile.depend b/lib/libiconv_modules/mapper_none/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_none/Makefile.depend
+++ b/lib/libiconv_modules/mapper_none/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_parallel/Makefile.depend b/lib/libiconv_modules/mapper_parallel/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_parallel/Makefile.depend
+++ b/lib/libiconv_modules/mapper_parallel/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_serial/Makefile.depend b/lib/libiconv_modules/mapper_serial/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_serial/Makefile.depend
+++ b/lib/libiconv_modules/mapper_serial/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_std/Makefile.depend b/lib/libiconv_modules/mapper_std/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_std/Makefile.depend
+++ b/lib/libiconv_modules/mapper_std/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libiconv_modules/mapper_zone/Makefile.depend b/lib/libiconv_modules/mapper_zone/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libiconv_modules/mapper_zone/Makefile.depend
+++ b/lib/libiconv_modules/mapper_zone/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile
index 39b929f..8a6c23d 100644
--- a/lib/liblzma/Makefile
+++ b/lib/liblzma/Makefile
@@ -154,10 +154,11 @@ CFLAGS+= -DSYMBOL_VERSIONING
CLEANFILES+= liblzma.pc
-.if !defined(LIBRARIES_ONLY)
-all: liblzma.pc
+FILES= liblzma.pc
+FILESDIR= ${LIBDATADIR}/pkgconfig
+
liblzma.pc: liblzma.pc.in
- @sed -e 's,@prefix@,/usr,g ; \
+ sed -e 's,@prefix@,/usr,g ; \
s,@exec_prefix@,/usr,g ; \
s,@libdir@,/usr/lib,g ; \
s,@includedir@,/usr/include,g ; \
@@ -166,9 +167,4 @@ liblzma.pc: liblzma.pc.in
s,@PTHREAD_CFLAGS@,,g ; \
s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}
-beforeinstall:
- @${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- liblzma.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
-.endif
-
.include <bsd.lib.mk>
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index f7057d1..752b82b 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -290,7 +290,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.24"
+#define PACKAGE_STRING "file 5.25"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -299,7 +299,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.24"
+#define PACKAGE_VERSION "5.25"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -330,7 +330,7 @@
/* Version number of package */
-#define VERSION "5.24"
+#define VERSION "5.25"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libmilter/Makefile.depend b/lib/libmilter/Makefile.depend
index 17c2027..f78862e 100644
--- a/lib/libmilter/Makefile.depend
+++ b/lib/libmilter/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libpam/Makefile.inc b/lib/libpam/Makefile.inc
index d2d1d42..59a8ced 100644
--- a/lib/libpam/Makefile.inc
+++ b/lib/libpam/Makefile.inc
@@ -27,7 +27,6 @@
CFLAGS+= -DOPENPAM_DEBUG
SHLIB_MAJOR= 5
-PAM_MOD_DIR= ${LIBDIR}
STATIC_CFLAGS+= -DOPENPAM_STATIC_MODULES
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index c8f13c4..1dc977f 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -155,7 +155,6 @@ MLINKS= pam.conf.5 pam.d.5
CSTD?= c99
CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include
CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR}
-CFLAGS+= -DOPENPAM_MODULES_DIRECTORY='"${PAM_MOD_DIR:C/\/*$//}/"'
CFLAGS+= -DHAVE_DLFUNC=1
CFLAGS+= -DHAVE_FDLOPEN=1
CFLAGS+= -DHAVE_FPURGE=1
diff --git a/lib/librpcsec_gss/Makefile.depend b/lib/librpcsec_gss/Makefile.depend
index b376142..a352749 100644
--- a/lib/librpcsec_gss/Makefile.depend
+++ b/lib/librpcsec_gss/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libsm/Makefile.depend b/lib/libsm/Makefile.depend
index 2b8cf93..5d2e4c0 100644
--- a/lib/libsm/Makefile.depend
+++ b/lib/libsm/Makefile.depend
@@ -83,8 +83,6 @@ mpeix.o: sm_os.h
mpeix.po: sm_os.h
niprop.o: sm_os.h
niprop.po: sm_os.h
-path.o: sm_os.h
-path.po: sm_os.h
put.o: sm_os.h
put.po: sm_os.h
refill.o: sm_os.h
diff --git a/lib/libsmb/Makefile.depend b/lib/libsmb/Makefile.depend
index 441168d..4d66c46 100644
--- a/lib/libsmb/Makefile.depend
+++ b/lib/libsmb/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libstand/Makefile.depend b/lib/libstand/Makefile.depend
index bb85bcd..57cd80c 100644
--- a/lib/libstand/Makefile.depend
+++ b/lib/libstand/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
include/arpa \
diff --git a/lib/libstdbuf/Makefile.depend b/lib/libstdbuf/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libstdbuf/Makefile.depend
+++ b/lib/libstdbuf/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend
index 441e1ee..0a2f351 100644
--- a/lib/libstdthreads/Makefile.depend
+++ b/lib/libstdthreads/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c
index a1e36d2..e533d1e 100644
--- a/lib/libugidfw/ugidfw.c
+++ b/lib/libugidfw/ugidfw.c
@@ -1233,7 +1233,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr)
name[len] = rulenum;
len++;
- error = sysctl(name, len, NULL, NULL, &rule, sizeof(rule));
+ error = sysctl(name, len, NULL, NULL, &rule, 0);
if (error) {
len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
rulenum, strerror(errno));
diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile
index 778732a..ea94e6d 100644
--- a/lib/libunbound/Makefile
+++ b/lib/libunbound/Makefile
@@ -5,7 +5,7 @@ LDNSDIR= ${.CURDIR}/../../contrib/ldns
UNBOUNDDIR= ${.CURDIR}/../../contrib/unbound
# Hold my beer and watch this
-.PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/ldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator
+.PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/sldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator
LIB= unbound
PRIVATELIB=
diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend
index 45199c4..9ae472e 100644
--- a/lib/libunbound/Makefile.depend
+++ b/lib/libunbound/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile
index 6560f8f..25d886a 100644
--- a/lib/libusb/Makefile
+++ b/lib/libusb/Makefile
@@ -35,16 +35,9 @@ SRCS+= libusb10_io.c
.if defined(COMPAT_32BIT)
CFLAGS+= -DCOMPAT_32BIT
-.endif
-
-.ifndef COMPAT_32BIT
-beforeinstall:
- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+.else
+FILES= libusb-0.1.pc libusb-1.0.pc libusb-2.0.pc
+FILESDIR= ${LIBDATADIR}/pkgconfig
.endif
#
diff --git a/lib/libvgl/Makefile.depend b/lib/libvgl/Makefile.depend
index 09164c1..dde2d60 100644
--- a/lib/libvgl/Makefile.depend
+++ b/lib/libvgl/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libxo/Makefile.depend b/lib/libxo/Makefile.depend
index dde2d60..e294271 100644
--- a/lib/libxo/Makefile.depend
+++ b/lib/libxo/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libutil \
usr.bin/xinstall.host \
diff --git a/lib/libz/Makefile b/lib/libz/Makefile
index 1f9bb72..aed4ee3 100644
--- a/lib/libz/Makefile
+++ b/lib/libz/Makefile
@@ -69,9 +69,8 @@ test: example minigzip
echo hello world | ./minigzip | ./minigzip -d )
.ifndef COMPAT_32BIT
-beforeinstall:
- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+FILES= zlib.pc
+FILESDIR= ${LIBDATADIR}/pkgconfig
.endif
.include <bsd.lib.mk>
diff --git a/lib/ncurses/form/Makefile.depend b/lib/ncurses/form/Makefile.depend
index fc0fd0c..e753747 100644
--- a/lib/ncurses/form/Makefile.depend
+++ b/lib/ncurses/form/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/ncurses/formw/Makefile.depend b/lib/ncurses/formw/Makefile.depend
index 04d041a4..1448c10 100644
--- a/lib/ncurses/formw/Makefile.depend
+++ b/lib/ncurses/formw/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/ncurses/menu/Makefile.depend b/lib/ncurses/menu/Makefile.depend
index cb8d80b..7dbcb2b 100644
--- a/lib/ncurses/menu/Makefile.depend
+++ b/lib/ncurses/menu/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/ncurses/menuw/Makefile.depend b/lib/ncurses/menuw/Makefile.depend
index 771e004..0ffbc9b 100644
--- a/lib/ncurses/menuw/Makefile.depend
+++ b/lib/ncurses/menuw/Makefile.depend
@@ -1,8 +1,6 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index fe68a39..94fb03a 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -282,6 +282,7 @@ CFLAGS+= -DFREEBSD_NATIVE -DTERMIOS
# Installed
HEADERS= curses.h term.h termcap.h unctrl.h
SRCHDRS= ncurses_dll.h
+CLEANFILES+= ncurses_dll.h
.if defined(ENABLE_WIDEC)
INCS= ${HEADERS} ${SRCHDRS}
OpenPOWER on IntegriCloud