Module Name: src Committed By: christos Date: Sat Jan 20 14:52:49 UTC 2024
Modified Files: src/lib/libc: Makefile.inc src/lib/libc/citrus: citrus_stdenc.h src/lib/libc/compat/gen: compat_errlist.c compat_frexp_ieee754.c compat_modf_ieee754.c compat_siglist.c compat_signame.c compat_syslog.c compat_timezone.c src/lib/libc/compat/include: locale.h signal.h time.h unistd.h src/lib/libc/compat/locale: compat_setlocale1.c src/lib/libc/compat/net: __cmsg_alignbytes.c src/lib/libc/compat/sys: Lint_Ovfork.c compat___sigaction14_sigtramp.c compat_fhopen.c compat_fhstatvfs.c compat_fhstatvfs1.c compat_getfh.c compat_getrusage.c compat_lfs_segwait.c compat_mount.c compat_sched.c compat_sigtimedwait.c compat_wait4.c src/lib/libc/db/db: db.c src/lib/libc/gdtoa: dtoa.c gdtoa.c src/lib/libc/gen: Lint_flt_rounds.c Makefile.inc _errno.c arc4random.c errno.c execl.c execv.c execvp.c getdevmajor.c getlogin.c getpwent.c humanize_number.c pthread_atfork.c pw_private.h sysctlgetmibinfo.c vis.c wordexp.c src/lib/libc/hash/md2: md2.c src/lib/libc/inet: inet_cidr_pton.c src/lib/libc/isc: Makefile.inc src/lib/libc/locale: __mb_cur_max.c generic_lc_all.c newlocale.c src/lib/libc/misc: initfini.c src/lib/libc/nameser: ns_name.c src/lib/libc/net: base64.c getaddrinfo.c getprotobyname.c getprotobynumber.c getservbyname.c getservbyport.c protoent.h rcmd.c sctp_sys_calls.c servent.h src/lib/libc/posix1e: acl_branding.c acl_calc_mask.c acl_copy.c acl_from_text.c acl_from_text_nfs4.c acl_support.h acl_support_nfs4.c acl_to_text_nfs4.c src/lib/libc/regex: Makefile.inc src/lib/libc/ssp: ssp_redirect.c src/lib/libc/stdio: Makefile.inc fread.c gettemp.c vfwprintf.c src/lib/libc/sys: Lint___vfork14.c Lint_clone.c Lint_ptrace.c makelintstub src/lib/libc/time: asctime.c difftime.c localtime.c private.h strftime.c src/lib/libc/tls: tls.c Added Files: src/lib/libc/compat/include: errno.h extern.h sched.h src/lib/libc/gen: errno_private.h getdevmajor_private.h Log Message: Catch up with all the lint warnings since exit on warning was disabled. Disable 'missing header declaration' and 'nested extern' warnings for now. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/Makefile.inc cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_stdenc.h cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/gen/compat_errlist.c \ src/lib/libc/compat/gen/compat_syslog.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/compat/gen/compat_frexp_ieee754.c \ src/lib/libc/compat/gen/compat_modf_ieee754.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/gen/compat_siglist.c \ src/lib/libc/compat/gen/compat_signame.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/gen/compat_timezone.c cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/include/errno.h \ src/lib/libc/compat/include/extern.h src/lib/libc/compat/include/sched.h cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/include/locale.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/compat/include/signal.h cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/time.h cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/include/unistd.h cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/locale/compat_setlocale1.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/net/__cmsg_alignbytes.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/sys/Lint_Ovfork.c \ src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/sys/compat_fhopen.c \ src/lib/libc/compat/sys/compat_fhstatvfs.c \ src/lib/libc/compat/sys/compat_fhstatvfs1.c \ src/lib/libc/compat/sys/compat_getrusage.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/compat/sys/compat_getfh.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/sys/compat_lfs_segwait.c \ src/lib/libc/compat/sys/compat_mount.c \ src/lib/libc/compat/sys/compat_sched.c \ src/lib/libc/compat/sys/compat_sigtimedwait.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/compat/sys/compat_wait4.c cvs rdiff -u -r1.20 -r1.21 src/lib/libc/db/db/db.c cvs rdiff -u -r1.11 -r1.12 src/lib/libc/gdtoa/dtoa.c cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gdtoa/gdtoa.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/gen/Lint_flt_rounds.c \ src/lib/libc/gen/pw_private.h src/lib/libc/gen/wordexp.c cvs rdiff -u -r1.216 -r1.217 src/lib/libc/gen/Makefile.inc cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/_errno.c cvs rdiff -u -r1.33 -r1.34 src/lib/libc/gen/arc4random.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/gen/errno.c cvs rdiff -u -r0 -r1.1 src/lib/libc/gen/errno_private.h \ src/lib/libc/gen/getdevmajor_private.h cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/execl.c \ src/lib/libc/gen/pthread_atfork.c cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gen/execv.c cvs rdiff -u -r1.31 -r1.32 src/lib/libc/gen/execvp.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/gen/getdevmajor.c cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/getlogin.c cvs rdiff -u -r1.83 -r1.84 src/lib/libc/gen/getpwent.c cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gen/humanize_number.c cvs rdiff -u -r1.15 -r1.16 src/lib/libc/gen/sysctlgetmibinfo.c cvs rdiff -u -r1.86 -r1.87 src/lib/libc/gen/vis.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/hash/md2/md2.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/inet/inet_cidr_pton.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/isc/Makefile.inc cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/__mb_cur_max.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/generic_lc_all.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/newlocale.c cvs rdiff -u -r1.16 -r1.17 src/lib/libc/misc/initfini.c cvs rdiff -u -r1.13 -r1.14 src/lib/libc/nameser/ns_name.c cvs rdiff -u -r1.16 -r1.17 src/lib/libc/net/base64.c cvs rdiff -u -r1.124 -r1.125 src/lib/libc/net/getaddrinfo.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/net/getprotobyname.c \ src/lib/libc/net/getprotobynumber.c src/lib/libc/net/servent.h cvs rdiff -u -r1.14 -r1.15 src/lib/libc/net/getservbyname.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/net/getservbyport.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/net/protoent.h cvs rdiff -u -r1.72 -r1.73 src/lib/libc/net/rcmd.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/net/sctp_sys_calls.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/posix1e/acl_branding.c \ src/lib/libc/posix1e/acl_calc_mask.c src/lib/libc/posix1e/acl_copy.c \ src/lib/libc/posix1e/acl_from_text.c \ src/lib/libc/posix1e/acl_from_text_nfs4.c \ src/lib/libc/posix1e/acl_support.h \ src/lib/libc/posix1e/acl_support_nfs4.c \ src/lib/libc/posix1e/acl_to_text_nfs4.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/regex/Makefile.inc cvs rdiff -u -r1.2 -r1.3 src/lib/libc/ssp/ssp_redirect.c cvs rdiff -u -r1.48 -r1.49 src/lib/libc/stdio/Makefile.inc cvs rdiff -u -r1.26 -r1.27 src/lib/libc/stdio/fread.c cvs rdiff -u -r1.21 -r1.22 src/lib/libc/stdio/gettemp.c cvs rdiff -u -r1.40 -r1.41 src/lib/libc/stdio/vfwprintf.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/sys/Lint___vfork14.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/sys/Lint_clone.c \ src/lib/libc/sys/Lint_ptrace.c cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/makelintstub cvs rdiff -u -r1.29 -r1.30 src/lib/libc/time/asctime.c cvs rdiff -u -r1.23 -r1.24 src/lib/libc/time/difftime.c cvs rdiff -u -r1.139 -r1.140 src/lib/libc/time/localtime.c cvs rdiff -u -r1.67 -r1.68 src/lib/libc/time/private.h cvs rdiff -u -r1.52 -r1.53 src/lib/libc/time/strftime.c cvs rdiff -u -r1.14 -r1.15 src/lib/libc/tls/tls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/Makefile.inc diff -u src/lib/libc/Makefile.inc:1.20 src/lib/libc/Makefile.inc:1.21 --- src/lib/libc/Makefile.inc:1.20 Tue Apr 20 17:42:31 2021 +++ src/lib/libc/Makefile.inc Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.20 2021/04/20 21:42:31 christos Exp $ +# $NetBSD: Makefile.inc,v 1.21 2024/01/20 14:52:45 christos Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -30,7 +30,7 @@ RUMPRUN?= no WARNS=5 CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -CPPFLAGS+= -D_DIAGNOSTIC +CPPFLAGS+= -D_DIAGNOSTIC -D_LIBC_INTERNAL .if defined(MLIBDIR) CPPFLAGS+= -DMLIBDIR=\"${MLIBDIR}\" .endif @@ -52,9 +52,13 @@ CPPFLAGS+= -DYP .endif # Set lint to exit on warnings -#LINTFLAGS+= -w +LINTFLAGS+= -w # ignore 'empty translation unit' warnings. LINTFLAGS+= -X 272 +# XXX: ignore 'missing header declaration' warnings (for now). +LINTFLAGS+= -X 351 +# XXX: ignore 'nested extern' warnings (for now). +LINTFLAGS+= -X 352 .include "libcincludes.mk" Index: src/lib/libc/citrus/citrus_stdenc.h diff -u src/lib/libc/citrus/citrus_stdenc.h:1.4 src/lib/libc/citrus/citrus_stdenc.h:1.5 --- src/lib/libc/citrus/citrus_stdenc.h:1.4 Sat Oct 29 14:02:04 2005 +++ src/lib/libc/citrus/citrus_stdenc.h Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_stdenc.h,v 1.4 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.h,v 1.5 2024/01/20 14:52:45 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -56,6 +56,9 @@ int _citrus_stdenc_open(struct _citrus_s char const * __restrict, const void * __restrict, size_t); void _citrus_stdenc_close(struct _citrus_stdenc *); + +extern struct _citrus_stdenc _citrus_stdenc_default; + __END_DECLS static __inline int Index: src/lib/libc/compat/gen/compat_errlist.c diff -u src/lib/libc/compat/gen/compat_errlist.c:1.2 src/lib/libc/compat/gen/compat_errlist.c:1.3 --- src/lib/libc/compat/gen/compat_errlist.c:1.2 Mon Oct 30 19:38:07 2006 +++ src/lib/libc/compat/gen/compat_errlist.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_errlist.c,v 1.2 2006/10/31 00:38:07 cbiere Exp $ */ +/* $NetBSD: compat_errlist.c,v 1.3 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1982, 1985, 1993 @@ -34,14 +34,13 @@ #if 0 static char sccsid[] = "@(#)errlst.c 8.2 (Berkeley) 11/16/93"; #else -__RCSID("$NetBSD: compat_errlist.c,v 1.2 2006/10/31 00:38:07 cbiere Exp $"); +__RCSID("$NetBSD: compat_errlist.c,v 1.3 2024/01/20 14:52:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include "namespace.h" -#define __LIBC12_SOURCE__ -#include <errno.h> +#include <compat/include/errno.h> #ifdef __weak_alias __weak_alias(sys_errlist, _sys_errlist) __weak_alias(__sys_errlist, _sys_errlist) Index: src/lib/libc/compat/gen/compat_syslog.c diff -u src/lib/libc/compat/gen/compat_syslog.c:1.2 src/lib/libc/compat/gen/compat_syslog.c:1.3 --- src/lib/libc/compat/gen/compat_syslog.c:1.2 Thu Oct 11 13:09:55 2012 +++ src/lib/libc/compat/gen/compat_syslog.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_syslog.c,v 1.2 2012/10/11 17:09:55 christos Exp $ */ +/* $NetBSD: compat_syslog.c,v 1.3 2024/01/20 14:52:45 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -37,17 +37,9 @@ #include <sys/types.h> #include <sys/syslog.h> +#include <compat/include/extern.h> #include <compat/sys/syslog.h> -void syslog_ss(int, struct syslog_data60 *, const char *, ...) - __printflike(3, 4); -void vsyslog_ss(int, struct syslog_data60 *, const char *, va_list) - __printflike(3, 0); -void syslogp_ss(int, struct syslog_data60 *, const char *, const char *, - const char *, ...) __printflike(5, 0); -void vsyslogp_ss(int, struct syslog_data60 *, const char *, const char *, - const char *, va_list) __printflike(5, 0); - #ifdef __weak_alias __weak_alias(closelog_r,_closelog_r) __weak_alias(openlog_r,_openlog_r) Index: src/lib/libc/compat/gen/compat_frexp_ieee754.c diff -u src/lib/libc/compat/gen/compat_frexp_ieee754.c:1.5 src/lib/libc/compat/gen/compat_frexp_ieee754.c:1.6 --- src/lib/libc/compat/gen/compat_frexp_ieee754.c:1.5 Fri Apr 23 15:04:54 2010 +++ src/lib/libc/compat/gen/compat_frexp_ieee754.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_frexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $ */ +/* $NetBSD: compat_frexp_ieee754.c,v 1.6 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -40,14 +40,13 @@ #if 0 static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: compat_frexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $"); +__RCSID("$NetBSD: compat_frexp_ieee754.c,v 1.6 2024/01/20 14:52:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <machine/ieee.h> - -double frexp(double, int *); +#include <math.h> /* * Split the given value into a fraction in the range [0.5, 1.0) and Index: src/lib/libc/compat/gen/compat_modf_ieee754.c diff -u src/lib/libc/compat/gen/compat_modf_ieee754.c:1.5 src/lib/libc/compat/gen/compat_modf_ieee754.c:1.6 --- src/lib/libc/compat/gen/compat_modf_ieee754.c:1.5 Fri Oct 7 07:10:44 2016 +++ src/lib/libc/compat/gen/compat_modf_ieee754.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_modf_ieee754.c,v 1.5 2016/10/07 11:10:44 christos Exp $ */ +/* $NetBSD: compat_modf_ieee754.c,v 1.6 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -30,8 +30,7 @@ #include <sys/types.h> #include <machine/ieee.h> #include <errno.h> - -double modf(double, double *); +#include <math.h> /* * double modf(double val, double *iptr) Index: src/lib/libc/compat/gen/compat_siglist.c diff -u src/lib/libc/compat/gen/compat_siglist.c:1.1 src/lib/libc/compat/gen/compat_siglist.c:1.2 --- src/lib/libc/compat/gen/compat_siglist.c:1.1 Mon Sep 12 21:44:09 2005 +++ src/lib/libc/compat/gen/compat_siglist.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_siglist.c,v 1.1 2005/09/13 01:44:09 christos Exp $ */ +/* $NetBSD: compat_siglist.c,v 1.2 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,10 +34,16 @@ #if 0 static char sccsid[] = "@(#)siglist.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: compat_siglist.c,v 1.1 2005/09/13 01:44:09 christos Exp $"); +__RCSID("$NetBSD: compat_siglist.c,v 1.2 2024/01/20 14:52:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +#define __LIBC12_SOURCE__ +#include <sys/time.h> +#include <compat/sys/time.h> +#include <signal.h> +#include <compat/include/signal.h> + #ifdef __weak_alias __weak_alias(sys_siglist, _sys_siglist) __weak_alias(__sys_siglist, _sys_siglist) Index: src/lib/libc/compat/gen/compat_signame.c diff -u src/lib/libc/compat/gen/compat_signame.c:1.1 src/lib/libc/compat/gen/compat_signame.c:1.2 --- src/lib/libc/compat/gen/compat_signame.c:1.1 Mon Sep 12 21:44:09 2005 +++ src/lib/libc/compat/gen/compat_signame.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_signame.c,v 1.1 2005/09/13 01:44:09 christos Exp $ */ +/* $NetBSD: compat_signame.c,v 1.2 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -34,14 +34,25 @@ #if 0 static char sccsid[] = "from: @(#)siglist.c 5.6 (Berkeley) 2/23/91";*/ #else -__RCSID("$NetBSD: compat_signame.c,v 1.1 2005/09/13 01:44:09 christos Exp $"); +__RCSID("$NetBSD: compat_signame.c,v 1.2 2024/01/20 14:52:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +#define __LIBC12_SOURCE__ +#include <sys/time.h> +#include <compat/sys/time.h> +#include <signal.h> +#include <compat/include/signal.h> + +#ifdef __weak_alias +__weak_alias(sys_signame, _sys_signame) +__weak_alias(__sys_signame, _sys_signame) +#endif + __warn_references(sys_signame, "warning: reference to compatibility sys_signame[]; include <signal.h> for correct reference") -const char *const sys_signame[] = { +const char *const _sys_signame[] = { "Signal 0", /* 0 */ "HUP", /* 1 SIGHUP */ "INT", /* 2 SIGINT */ Index: src/lib/libc/compat/gen/compat_timezone.c diff -u src/lib/libc/compat/gen/compat_timezone.c:1.4 src/lib/libc/compat/gen/compat_timezone.c:1.5 --- src/lib/libc/compat/gen/compat_timezone.c:1.4 Tue Mar 20 13:05:59 2012 +++ src/lib/libc/compat/gen/compat_timezone.c Sat Jan 20 09:52:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_timezone.c,v 1.4 2012/03/20 17:05:59 matt Exp $ */ +/* $NetBSD: compat_timezone.c,v 1.5 2024/01/20 14:52:45 christos Exp $ */ /* * Copyright (c) 1987, 1993 @@ -34,11 +34,12 @@ #if 0 static char sccsid[] = "@(#)timezone.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: compat_timezone.c,v 1.4 2012/03/20 17:05:59 matt Exp $"); +__RCSID("$NetBSD: compat_timezone.c,v 1.5 2024/01/20 14:52:45 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ +#define __TIMEZONE_FUNCTION__ #include "namespace.h" #include <sys/types.h> @@ -60,11 +61,8 @@ __warn_references(timezone, * application code, by a call to localtime. */ -char *_tztab(int, int); - static char czone[TZ_MAX_CHARS]; /* space for zone name */ -char *timezone(int, int); char * timezone(int zone, int dst) { Index: src/lib/libc/compat/include/locale.h diff -u src/lib/libc/compat/include/locale.h:1.1 src/lib/libc/compat/include/locale.h:1.2 --- src/lib/libc/compat/include/locale.h:1.1 Mon Jun 7 09:52:30 2010 +++ src/lib/libc/compat/include/locale.h Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: locale.h,v 1.1 2010/06/07 13:52:30 tnozaki Exp $ */ +/* $NetBSD: locale.h,v 1.2 2024/01/20 14:52:46 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -39,6 +39,12 @@ __BEGIN_DECLS char *setlocale(int, const char *); char *__setlocale_mb_len_max_32(int, const char *); +/* + * Preparation for the future import of multibyte locale. + * This function will ensure binary compatibility for old executables. + */ +char * +compat_setlocale(int category, const char *locale) __RENAME(setlocale); __END_DECLS #endif /* _COMPAT_LOCALE_H_ */ Index: src/lib/libc/compat/include/signal.h diff -u src/lib/libc/compat/include/signal.h:1.3 src/lib/libc/compat/include/signal.h:1.4 --- src/lib/libc/compat/include/signal.h:1.3 Tue Nov 2 02:54:10 2021 +++ src/lib/libc/compat/include/signal.h Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: signal.h,v 1.3 2021/11/02 06:54:10 thorpej Exp $ */ +/* $NetBSD: signal.h,v 1.4 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,6 +37,12 @@ #include <compat/sys/signal.h> __BEGIN_DECLS +#if defined(_NETBSD_SOURCE) +extern const char *const _sys_signame[]; +extern const char *const _sys_siglist[]; +extern const int sys_nsig; +#endif + int sigaction(int, const struct sigaction13 * __restrict, struct sigaction13 * __restrict); int __sigaction_siginfo(int, const struct sigaction * __restrict, @@ -68,6 +74,8 @@ int __sigtimedwait50(const sigset_t * __ siginfo_t * __restrict, const struct timespec * __restrict); int ____sigtimedwait50(const sigset_t * __restrict, siginfo_t * __restrict, struct timespec * __restrict); +int __libc_sigaction14(int, const struct sigaction *, struct sigaction *); + /* * X/Open CAE Specification Issue 4 Version 2 */ @@ -78,6 +86,15 @@ int sigaltstack(const struct sigaltstack int __sigaltstack14(const stack_t * __restrict, stack_t * __restrict); #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ +#define C(a,b) __CONCAT(a,b) +#define __SIGTRAMP_SIGCONTEXT \ + C(__sigtramp_sigcontext_,__SIGTRAMP_SIGCONTEXT_VERSION) +#define __SIGTRAMP_SIGINFO \ + C(__sigtramp_siginfo_,__SIGTRAMP_SIGINFO_VERSION) + +extern const char __SIGTRAMP_SIGINFO[]; +extern const char __SIGTRAMP_SIGCONTEXT[]; + __END_DECLS #endif /* !_COMPAT_SIGNAL_H_ */ Index: src/lib/libc/compat/include/time.h diff -u src/lib/libc/compat/include/time.h:1.4 src/lib/libc/compat/include/time.h:1.5 --- src/lib/libc/compat/include/time.h:1.4 Thu Oct 29 23:08:56 2015 +++ src/lib/libc/compat/include/time.h Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: time.h,v 1.4 2015/10/30 03:08:56 christos Exp $ */ +/* $NetBSD: time.h,v 1.5 2024/01/20 14:52:46 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -49,10 +49,12 @@ __BEGIN_DECLS #if (_XOPEN_SOURCE - 0) >= 4 || defined(_NETBSD_SOURCE) char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict); -#if 0 -#if defined(_NETBSD_SOURCE) +#ifdef __TIMEZONE_FUNCTION__ char *timezone(int, int); -#endif /* _NETBSD_SOURCE */ +char *_tztab(int, int); +#else +extern int daylight; +extern long timezone __RENAME(__timezone13); #endif #endif /* !_ANSI_SOURCE */ Index: src/lib/libc/compat/include/unistd.h diff -u src/lib/libc/compat/include/unistd.h:1.2 src/lib/libc/compat/include/unistd.h:1.3 --- src/lib/libc/compat/include/unistd.h:1.2 Mon Apr 28 16:22:59 2008 +++ src/lib/libc/compat/include/unistd.h Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.2 2008/04/28 20:22:59 martin Exp $ */ +/* $NetBSD: unistd.h,v 1.3 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -64,8 +64,8 @@ #define _COMPAT_UNISTD_H_ __BEGIN_DECLS -pid_t vfork(void); -pid_t __vfork14(void); +pid_t vfork(void) __returns_twice; +pid_t __vfork14(void) __returns_twice; __END_DECLS #endif /* !_COMPAT_UNISTD_H_ */ Index: src/lib/libc/compat/locale/compat_setlocale1.c diff -u src/lib/libc/compat/locale/compat_setlocale1.c:1.2 src/lib/libc/compat/locale/compat_setlocale1.c:1.3 --- src/lib/libc/compat/locale/compat_setlocale1.c:1.2 Fri Sep 13 09:13:32 2013 +++ src/lib/libc/compat/locale/compat_setlocale1.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_setlocale1.c,v 1.2 2013/09/13 13:13:32 joerg Exp $ */ +/* $NetBSD: compat_setlocale1.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,7 +30,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_setlocale1.c,v 1.2 2013/09/13 13:13:32 joerg Exp $"); +__RCSID("$NetBSD: compat_setlocale1.c,v 1.3 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -44,13 +44,6 @@ __warn_references(setlocale, "warning: reference to compatibility setlocale();" "include <locale.h> for correct reference") -/* - * Preparation for the future import of multibyte locale. - * This function will ensure binary compatibility for old executables. - */ -char * -compat_setlocale(int category, const char *locale) __RENAME(setlocale); - char * compat_setlocale(int category, const char *locale) { Index: src/lib/libc/compat/net/__cmsg_alignbytes.c diff -u src/lib/libc/compat/net/__cmsg_alignbytes.c:1.1 src/lib/libc/compat/net/__cmsg_alignbytes.c:1.2 --- src/lib/libc/compat/net/__cmsg_alignbytes.c:1.1 Fri Jan 20 09:08:05 2012 +++ src/lib/libc/compat/net/__cmsg_alignbytes.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: __cmsg_alignbytes.c,v 1.1 2012/01/20 14:08:05 joerg Exp $ */ +/* $NetBSD: __cmsg_alignbytes.c,v 1.2 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: __cmsg_alignbytes.c,v 1.1 2012/01/20 14:08:05 joerg Exp $"); +__RCSID("$NetBSD: __cmsg_alignbytes.c,v 1.2 2024/01/20 14:52:46 christos Exp $"); #include "namespace.h" #include <sys/types.h> @@ -38,7 +38,7 @@ __RCSID("$NetBSD: __cmsg_alignbytes.c,v #include <sys/sysctl.h> #include <sys/socket.h> -int __cmsg_alignbytes(void); +#include <compat/include/extern.h> int __cmsg_alignbytes(void) Index: src/lib/libc/compat/sys/Lint_Ovfork.c diff -u src/lib/libc/compat/sys/Lint_Ovfork.c:1.1 src/lib/libc/compat/sys/Lint_Ovfork.c:1.2 --- src/lib/libc/compat/sys/Lint_Ovfork.c:1.1 Sat Mar 11 16:07:18 2006 +++ src/lib/libc/compat/sys/Lint_Ovfork.c Sat Jan 20 09:52:46 2024 @@ -1,21 +1,15 @@ -/* $NetBSD: Lint_Ovfork.c,v 1.1 2006/03/11 21:07:18 christos Exp $ */ +/* $NetBSD: Lint_Ovfork.c,v 1.2 2024/01/20 14:52:46 christos Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ -#if 0 #include <unistd.h> -#else -#include <sys/cdefs.h> -#include <sys/types.h> -pid_t vfork __P((void)); -#endif /*ARGSUSED*/ pid_t -vfork() +vfork(void) { return (0); } Index: src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c diff -u src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c:1.1 src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c:1.2 --- src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c:1.1 Mon Nov 1 01:53:45 2021 +++ src/lib/libc/compat/sys/compat___sigaction14_sigtramp.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat___sigaction14_sigtramp.c,v 1.1 2021/11/01 05:53:45 thorpej Exp $ */ +/* $NetBSD: compat___sigaction14_sigtramp.c,v 1.2 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -31,36 +31,25 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat___sigaction14_sigtramp.c,v 1.1 2021/11/01 05:53:45 thorpej Exp $"); +__RCSID("$NetBSD: compat___sigaction14_sigtramp.c,v 1.2 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ +#define __LIBC12_SOURCE__ #include <sys/types.h> #include <stddef.h> +#include <sys/time.h> +#include <compat/sys/time.h> #include <signal.h> +#include <compat/include/signal.h> #include <errno.h> #include "extern.h" -#define C(a,b) __CONCAT(a,b) -#define __SIGTRAMP_SIGCONTEXT \ - C(__sigtramp_sigcontext_,__SIGTRAMP_SIGCONTEXT_VERSION) -#define __SIGTRAMP_SIGINFO \ - C(__sigtramp_siginfo_,__SIGTRAMP_SIGINFO_VERSION) - __weak_alias(__sigaction14, __libc_sigaction14) -#define __LIBC12_SOURCE__ - -/* - * The symbol must remain, but we don't want this exposed in a header - * anywhere, so the prototype goes here. - */ -int __libc_sigaction14(int, const struct sigaction *, struct sigaction *); - int __libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact) { - extern const char __SIGTRAMP_SIGINFO[]; /* * If no sigaction, use the "default" trampoline since it won't @@ -75,7 +64,6 @@ __libc_sigaction14(int sig, const struct * set in the sigaction. */ if ((act->sa_flags & SA_SIGINFO) == 0) { - extern const char __SIGTRAMP_SIGCONTEXT[]; int sav = errno; int rv = __sigaction_sigtramp(sig, act, oact, __SIGTRAMP_SIGCONTEXT, __SIGTRAMP_SIGCONTEXT_VERSION); Index: src/lib/libc/compat/sys/compat_fhopen.c diff -u src/lib/libc/compat/sys/compat_fhopen.c:1.4 src/lib/libc/compat/sys/compat_fhopen.c:1.5 --- src/lib/libc/compat/sys/compat_fhopen.c:1.4 Mon Apr 28 16:22:59 2008 +++ src/lib/libc/compat/sys/compat_fhopen.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_fhopen.c,v 1.4 2008/04/28 20:22:59 martin Exp $ */ +/* $NetBSD: compat_fhopen.c,v 1.5 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -32,22 +32,20 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_fhopen.c,v 1.4 2008/04/28 20:22:59 martin Exp $"); +__RCSID("$NetBSD: compat_fhopen.c,v 1.5 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ #include <sys/types.h> #include <sys/mount.h> +#include <compat/sys/mount.h> #include <compat/include/fstypes.h> __warn_references(fhopen, "warning: reference to compatibility fhopen(); include <sys/mount.h> to generate correct reference") -int __fhopen40(const void *, size_t, int); -int fhopen(const struct compat_30_fhandle *, int); - /* * Convert old fhopen() call to new calling convention */ Index: src/lib/libc/compat/sys/compat_fhstatvfs.c diff -u src/lib/libc/compat/sys/compat_fhstatvfs.c:1.4 src/lib/libc/compat/sys/compat_fhstatvfs.c:1.5 --- src/lib/libc/compat/sys/compat_fhstatvfs.c:1.4 Sun Sep 22 18:59:38 2019 +++ src/lib/libc/compat/sys/compat_fhstatvfs.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_fhstatvfs.c,v 1.4 2019/09/22 22:59:38 christos Exp $ */ +/* $NetBSD: compat_fhstatvfs.c,v 1.5 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_fhstatvfs.c,v 1.4 2019/09/22 22:59:38 christos Exp $"); +__RCSID("$NetBSD: compat_fhstatvfs.c,v 1.5 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -45,8 +45,6 @@ __RCSID("$NetBSD: compat_fhstatvfs.c,v 1 __warn_references(fhstatvfs, "warning: reference to compatibility fhstatvfs(); include <sys/statvfs.h> to generate correct reference") -int fhstatvfs(const struct compat_30_fhandle *fhp, struct statvfs90 *buf); - /* * Convert old fhstatvs() call to new calling convention */ Index: src/lib/libc/compat/sys/compat_fhstatvfs1.c diff -u src/lib/libc/compat/sys/compat_fhstatvfs1.c:1.4 src/lib/libc/compat/sys/compat_fhstatvfs1.c:1.5 --- src/lib/libc/compat/sys/compat_fhstatvfs1.c:1.4 Sun Sep 22 18:59:38 2019 +++ src/lib/libc/compat/sys/compat_fhstatvfs1.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_fhstatvfs1.c,v 1.4 2019/09/22 22:59:38 christos Exp $ */ +/* $NetBSD: compat_fhstatvfs1.c,v 1.5 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_fhstatvfs1.c,v 1.4 2019/09/22 22:59:38 christos Exp $"); +__RCSID("$NetBSD: compat_fhstatvfs1.c,v 1.5 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -45,9 +45,6 @@ __RCSID("$NetBSD: compat_fhstatvfs1.c,v __warn_references(fhstatvfs1, "warning: reference to compatibility fhstatvfs1(); include <sys/statvfs.h> to generate correct reference") -int fhstatvfs1(const struct compat_30_fhandle *fhp, struct statvfs90 *buf, - int flags); - /* * Convert old fhstatvs1() call to new calling convention */ Index: src/lib/libc/compat/sys/compat_getrusage.c diff -u src/lib/libc/compat/sys/compat_getrusage.c:1.4 src/lib/libc/compat/sys/compat_getrusage.c:1.5 --- src/lib/libc/compat/sys/compat_getrusage.c:1.4 Fri Oct 4 17:07:37 2013 +++ src/lib/libc/compat/sys/compat_getrusage.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_getrusage.c,v 1.4 2013/10/04 21:07:37 christos Exp $ */ +/* $NetBSD: compat_getrusage.c,v 1.5 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_getrusage.c,v 1.4 2013/10/04 21:07:37 christos Exp $"); +__RCSID("$NetBSD: compat_getrusage.c,v 1.5 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -47,19 +47,6 @@ __warn_references(getrusage, __strong_alias(getrusage, __compat_getrusage) -void __rusage_to_rusage50(const struct rusage *, struct rusage50 *); - -void -__rusage_to_rusage50(const struct rusage *ru, struct rusage50 *ru50) -{ - (void)memcpy(&ru50->ru_first, &ru->ru_first, - (size_t)((char *)(void *)&ru50->ru_last - - (char *)(void *)&ru50->ru_first)); - ru50->ru_maxrss = ru->ru_maxrss; - timeval_to_timeval50(&ru->ru_utime, &ru50->ru_utime); - timeval_to_timeval50(&ru->ru_stime, &ru50->ru_stime); -} - /* * libc12 compatible getrusage routine. */ @@ -71,6 +58,6 @@ __compat_getrusage(int who, struct rusag if ((rv = __getrusage50(who, &ru)) == -1) return rv; - __rusage_to_rusage50(&ru, ru50); + rusage_to_rusage50(&ru, ru50); return rv; } Index: src/lib/libc/compat/sys/compat_getfh.c diff -u src/lib/libc/compat/sys/compat_getfh.c:1.6 src/lib/libc/compat/sys/compat_getfh.c:1.7 --- src/lib/libc/compat/sys/compat_getfh.c:1.6 Mon Apr 28 16:22:59 2008 +++ src/lib/libc/compat/sys/compat_getfh.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_getfh.c,v 1.6 2008/04/28 20:22:59 martin Exp $ */ +/* $NetBSD: compat_getfh.c,v 1.7 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -32,13 +32,14 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_getfh.c,v 1.6 2008/04/28 20:22:59 martin Exp $"); +__RCSID("$NetBSD: compat_getfh.c,v 1.7 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ #include <sys/types.h> #include <sys/mount.h> +#include <compat/sys/mount.h> #include <compat/include/fstypes.h> #include <errno.h> @@ -47,9 +48,6 @@ __warn_references(getfh, "warning: reference to compatibility getfh(); include <sys/mount.h> to generate correct reference") -int __getfh30(const char *, void*, size_t *); -int getfh(const char *path, struct compat_30_fhandle *fhp); - /* * Convert old getfh() call to new calling convention */ Index: src/lib/libc/compat/sys/compat_lfs_segwait.c diff -u src/lib/libc/compat/sys/compat_lfs_segwait.c:1.2 src/lib/libc/compat/sys/compat_lfs_segwait.c:1.3 --- src/lib/libc/compat/sys/compat_lfs_segwait.c:1.2 Sat Jan 10 21:46:26 2009 +++ src/lib/libc/compat/sys/compat_lfs_segwait.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_lfs_segwait.c,v 1.2 2009/01/11 02:46:26 christos Exp $ */ +/* $NetBSD: compat_lfs_segwait.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_lfs_segwait.c,v 1.2 2009/01/11 02:46:26 christos Exp $"); +__RCSID("$NetBSD: compat_lfs_segwait.c,v 1.3 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,12 +46,11 @@ __RCSID("$NetBSD: compat_lfs_segwait.c,v #include <sys/fstypes.h> #include <sys/time.h> #include <compat/sys/time.h> +#include <compat/ufs/lfs/lfs_extern.h> __warn_references(lfs_segwait, "warning: reference to compatibility lfs_segwait(); include <???.h> to generate correct reference") -int lfs_segwait(fsid_t *, struct timeval50 *); -int __lfs_segwait50(fsid_t *, struct timeval *); int lfs_segwait(fsid_t *fsid, struct timeval50 *ts50) { Index: src/lib/libc/compat/sys/compat_mount.c diff -u src/lib/libc/compat/sys/compat_mount.c:1.2 src/lib/libc/compat/sys/compat_mount.c:1.3 --- src/lib/libc/compat/sys/compat_mount.c:1.2 Wed Jul 18 16:10:47 2007 +++ src/lib/libc/compat/sys/compat_mount.c Sat Jan 20 09:52:46 2024 @@ -1,22 +1,20 @@ -/* $NetBSD: compat_mount.c,v 1.2 2007/07/18 20:10:47 dsl Exp $ */ +/* $NetBSD: compat_mount.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_mount.c,v 1.2 2007/07/18 20:10:47 dsl Exp $"); +__RCSID("$NetBSD: compat_mount.c,v 1.3 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ #include <sys/types.h> #include <sys/mount.h> +#include <compat/sys/mount.h> __warn_references(mount, "warning: reference to compatibility mount(); include <sys/mount.h> to generate correct reference") -int mount(const char *, const char *, int, void *); -int __mount50(const char *, const char *, int, void *, size_t); - /* * Convert old mount() call to new calling convention * The kernel will treat length 0 as 'default for the fs'. Index: src/lib/libc/compat/sys/compat_sched.c diff -u src/lib/libc/compat/sys/compat_sched.c:1.2 src/lib/libc/compat/sys/compat_sched.c:1.3 --- src/lib/libc/compat/sys/compat_sched.c:1.2 Sat Jan 10 21:46:26 2009 +++ src/lib/libc/compat/sys/compat_sched.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_sched.c,v 1.2 2009/01/11 02:46:26 christos Exp $ */ +/* $NetBSD: compat_sched.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_sched.c,v 1.2 2009/01/11 02:46:26 christos Exp $"); +__RCSID("$NetBSD: compat_sched.c,v 1.3 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -40,13 +40,12 @@ __RCSID("$NetBSD: compat_sched.c,v 1.2 2 #include <sys/types.h> #include <sys/time.h> #include <compat/sys/time.h> +#include <compat/include/sched.h> #include <unistd.h> __warn_references(sched_rr_get_interval, "warning: reference to compatibility sched_rr_get_interval(); include <sched.h> to generate correct reference") -int sched_rr_get_interval(pid_t, struct timespec50 *); - int /*ARGSUSED*/ sched_rr_get_interval(pid_t pid, struct timespec50 *interval) Index: src/lib/libc/compat/sys/compat_sigtimedwait.c diff -u src/lib/libc/compat/sys/compat_sigtimedwait.c:1.2 src/lib/libc/compat/sys/compat_sigtimedwait.c:1.3 --- src/lib/libc/compat/sys/compat_sigtimedwait.c:1.2 Sat Jan 10 21:46:27 2009 +++ src/lib/libc/compat/sys/compat_sigtimedwait.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_sigtimedwait.c,v 1.2 2009/01/11 02:46:27 christos Exp $ */ +/* $NetBSD: compat_sigtimedwait.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -37,10 +37,11 @@ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_sigtimedwait.c,v 1.2 2009/01/11 02:46:27 christos Exp $"); +__RCSID("$NetBSD: compat_sigtimedwait.c,v 1.3 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" +#undef sys_siglist #define __LIBC12_SOURCE__ #include <time.h> #include <compat/include/time.h> Index: src/lib/libc/compat/sys/compat_wait4.c diff -u src/lib/libc/compat/sys/compat_wait4.c:1.3 src/lib/libc/compat/sys/compat_wait4.c:1.4 --- src/lib/libc/compat/sys/compat_wait4.c:1.3 Thu Mar 26 07:17:08 2015 +++ src/lib/libc/compat/sys/compat_wait4.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_wait4.c,v 1.3 2015/03/26 11:17:08 justin Exp $ */ +/* $NetBSD: compat_wait4.c,v 1.4 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: compat_wait4.c,v 1.3 2015/03/26 11:17:08 justin Exp $"); +__RCSID("$NetBSD: compat_wait4.c,v 1.4 2024/01/20 14:52:46 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #define __LIBC12_SOURCE__ @@ -39,8 +39,8 @@ __RCSID("$NetBSD: compat_wait4.c,v 1.3 2 #include "namespace.h" #include <sys/types.h> #include <sys/wait.h> -#include <compat/sys/wait.h> #include <sys/resource.h> +#include <compat/sys/wait.h> #include <compat/sys/resource.h> __warn_references(wait3, @@ -48,8 +48,6 @@ __warn_references(wait3, __warn_references(wait4, "warning: reference to compatibility wait4(); include <sys/wait.h> to generate correct reference") -extern void __rusage_to_rusage50(const struct rusage *, struct rusage50 *); - #ifdef __weak_alias __weak_alias(wait4, _wait4) __weak_alias(_sys_wait4, _wait4) @@ -68,7 +66,7 @@ wait3(int *status, int options, struct r if ((rv = __wait350(status, options, ru50 ? &ru : NULL)) == -1) return rv; if (ru50) - __rusage_to_rusage50(&ru, ru50); + rusage_to_rusage50(&ru, ru50); return rv; } @@ -81,6 +79,6 @@ wait4(pid_t wpid, int *status, int optio if ((rv = __wait450(wpid, status, options, ru50 ? &ru : NULL)) == -1) return rv; if (ru50) - __rusage_to_rusage50(&ru, ru50); + rusage_to_rusage50(&ru, ru50); return rv; } Index: src/lib/libc/db/db/db.c diff -u src/lib/libc/db/db/db.c:1.20 src/lib/libc/db/db/db.c:1.21 --- src/lib/libc/db/db/db.c:1.20 Sat Oct 5 14:07:58 2019 +++ src/lib/libc/db/db/db.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: db.c,v 1.20 2019/10/05 18:07:58 uwe Exp $ */ +/* $NetBSD: db.c,v 1.21 2024/01/20 14:52:46 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #endif #include <sys/cdefs.h> -__RCSID("$NetBSD: db.c,v 1.20 2019/10/05 18:07:58 uwe Exp $"); +__RCSID("$NetBSD: db.c,v 1.21 2024/01/20 14:52:46 christos Exp $"); #include "namespace.h" #include <sys/types.h> @@ -81,6 +81,7 @@ dbopen(const char *fname, int flags, mod return (NULL); } +/*ARGSUSED*/ static int __dberr(const DB *dbp, ...) { Index: src/lib/libc/gdtoa/dtoa.c diff -u src/lib/libc/gdtoa/dtoa.c:1.11 src/lib/libc/gdtoa/dtoa.c:1.12 --- src/lib/libc/gdtoa/dtoa.c:1.11 Thu May 6 12:15:33 2021 +++ src/lib/libc/gdtoa/dtoa.c Sat Jan 20 09:52:46 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: dtoa.c,v 1.11 2021/05/06 16:15:33 christos Exp $ */ +/* $NetBSD: dtoa.c,v 1.12 2024/01/20 14:52:46 christos Exp $ */ /**************************************************************** @@ -366,7 +366,7 @@ dtoa } else if (( jj1 = -k )!=0) { dval(&d) *= tens[jj1 & 0xf]; - for(j = jj1 >> 4; j; j >>= 1, i++) + for(j = (unsigned int)jj1 >> 4; j; j = (unsigned int)j >> 1, i++) if (j & 1) { ieps++; dval(&d) *= bigtens[i]; Index: src/lib/libc/gdtoa/gdtoa.c diff -u src/lib/libc/gdtoa/gdtoa.c:1.10 src/lib/libc/gdtoa/gdtoa.c:1.11 --- src/lib/libc/gdtoa/gdtoa.c:1.10 Tue Jan 2 14:27:26 2024 +++ src/lib/libc/gdtoa/gdtoa.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: gdtoa.c,v 1.10 2024/01/02 19:27:26 christos Exp $ */ +/* $NetBSD: gdtoa.c,v 1.11 2024/01/20 14:52:47 christos Exp $ */ /**************************************************************** @@ -372,7 +372,7 @@ gdtoa ds = 1.; if ( (jj1 = -k) !=0) { dval(&d) *= tens[jj1 & 0xf]; - for(j = (unsigned int)jj1 >> 4; j; j >>= 1, i++) + for(j = (unsigned int)jj1 >> 4; j; j = (unsigned int)j >> 1, i++) if (j & 1) { ieps++; dval(&d) *= bigtens[i]; Index: src/lib/libc/gen/Lint_flt_rounds.c diff -u src/lib/libc/gen/Lint_flt_rounds.c:1.3 src/lib/libc/gen/Lint_flt_rounds.c:1.4 --- src/lib/libc/gen/Lint_flt_rounds.c:1.3 Sun Jun 24 11:26:03 2012 +++ src/lib/libc/gen/Lint_flt_rounds.c Sat Jan 20 09:52:47 2024 @@ -1,9 +1,10 @@ -/* $NetBSD: Lint_flt_rounds.c,v 1.3 2012/06/24 15:26:03 christos Exp $ */ +/* $NetBSD: Lint_flt_rounds.c,v 1.4 2024/01/20 14:52:47 christos Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ +#include <float.h> /*ARGSUSED*/ int Index: src/lib/libc/gen/pw_private.h diff -u src/lib/libc/gen/pw_private.h:1.3 src/lib/libc/gen/pw_private.h:1.4 --- src/lib/libc/gen/pw_private.h:1.3 Tue Mar 20 12:36:05 2012 +++ src/lib/libc/gen/pw_private.h Sat Jan 20 09:52:47 2024 @@ -1,8 +1,10 @@ -/* $NetBSD: pw_private.h,v 1.3 2012/03/20 16:36:05 matt Exp $ */ +/* $NetBSD: pw_private.h,v 1.4 2024/01/20 14:52:47 christos Exp $ */ /* * Written by Jason R. Thorpe <thor...@netbsd.org>, June 26, 1998. * Public domain. */ + +extern const char __yp_token[]; int __pw_scan(char *bp, struct passwd *pw, int *flags); Index: src/lib/libc/gen/wordexp.c diff -u src/lib/libc/gen/wordexp.c:1.3 src/lib/libc/gen/wordexp.c:1.4 --- src/lib/libc/gen/wordexp.c:1.3 Wed Feb 11 23:10:52 2009 +++ src/lib/libc/gen/wordexp.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: wordexp.c,v 1.3 2009/02/12 04:10:52 lukem Exp $ */ +/* $NetBSD: wordexp.c,v 1.4 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2002 Tim J. Robbins. @@ -38,12 +38,13 @@ #include <string.h> #include <unistd.h> #include <wordexp.h> +#include "extern.h" #if defined(LIBC_SCCS) && !defined(lint) #if 0 __FBSDID("$FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/wordexp.c,v 1.5 2004/04/09 11:32:32 tjr Exp $"); #else -__RCSID("$NetBSD: wordexp.c,v 1.3 2009/02/12 04:10:52 lukem Exp $"); +__RCSID("$NetBSD: wordexp.c,v 1.4 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -104,7 +105,6 @@ we_askshell(const char *words, wordexp_t char *nstrings; /* Temporary for realloc() */ char **nwv; /* Temporary for realloc() */ FILE *fp; /* Stream to read pipe */ - extern char **environ; char *cmd; if ((ifs = getenv("IFS")) == NULL) Index: src/lib/libc/gen/Makefile.inc diff -u src/lib/libc/gen/Makefile.inc:1.216 src/lib/libc/gen/Makefile.inc:1.217 --- src/lib/libc/gen/Makefile.inc:1.216 Tue May 31 09:42:59 2022 +++ src/lib/libc/gen/Makefile.inc Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.216 2022/05/31 13:42:59 riastradh Exp $ +# $NetBSD: Makefile.inc,v 1.217 2024/01/20 14:52:47 christos Exp $ # from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # gen sources @@ -210,4 +210,8 @@ CPPFLAGS.toupper_.c+= -I${LIBCDIR}/local errlist.c: errlist.awk ${NETBSDSRCDIR}/sys/sys/errno.h ${TOOL_AWK} -f ${.ALLSRC} > ${.TARGET} +LINTFLAGS.rb.c += -X 231 # XXX: marked as unused already why? +LINTFLAGS.siglist.c += -X 351 # XXX: renames +LINTFLAGS.signame.c += -X 351 # XXX: renames + CLEANFILES+= errlist.c Index: src/lib/libc/gen/_errno.c diff -u src/lib/libc/gen/_errno.c:1.13 src/lib/libc/gen/_errno.c:1.14 --- src/lib/libc/gen/_errno.c:1.13 Mon Apr 28 16:22:59 2008 +++ src/lib/libc/gen/_errno.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: _errno.c,v 1.13 2008/04/28 20:22:59 martin Exp $ */ +/* $NetBSD: _errno.c,v 1.14 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -31,15 +31,14 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _errno.c,v 1.13 2008/04/28 20:22:59 martin Exp $"); +__RCSID("$NetBSD: _errno.c,v 1.14 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "reentrant.h" #include <errno.h> #include <stdlib.h> -#undef errno -extern int errno; +#include "errno_private.h" int * __errno(void) Index: src/lib/libc/gen/arc4random.c diff -u src/lib/libc/gen/arc4random.c:1.33 src/lib/libc/gen/arc4random.c:1.34 --- src/lib/libc/gen/arc4random.c:1.33 Tue Apr 19 16:32:15 2022 +++ src/lib/libc/gen/arc4random.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: arc4random.c,v 1.33 2022/04/19 20:32:15 rillig Exp $ */ +/* $NetBSD: arc4random.c,v 1.34 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: arc4random.c,v 1.33 2022/04/19 20:32:15 rillig Exp $"); +__RCSID("$NetBSD: arc4random.c,v 1.34 2024/01/20 14:52:47 christos Exp $"); #include "namespace.h" #include "reentrant.h" @@ -125,7 +125,7 @@ rotate(uint32_t u, unsigned c) (c) += (d); (b) ^= (c); (b) = rotate((b), 7); \ } while (0) -const uint8_t crypto_core_constant32[16] = "expand 32-byte k"; +static const uint8_t crypto_core_constant32[16] = "expand 32-byte k"; static void crypto_core(uint8_t *out, const uint8_t *in, const uint8_t *k, Index: src/lib/libc/gen/errno.c diff -u src/lib/libc/gen/errno.c:1.5 src/lib/libc/gen/errno.c:1.6 --- src/lib/libc/gen/errno.c:1.5 Sun Jun 12 01:21:27 2005 +++ src/lib/libc/gen/errno.c Sat Jan 20 09:52:47 2024 @@ -1,8 +1,11 @@ -/* $NetBSD: errno.c,v 1.5 2005/06/12 05:21:27 lukem Exp $ */ +/* $NetBSD: errno.c,v 1.6 2024/01/20 14:52:47 christos Exp $ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: errno.c,v 1.5 2005/06/12 05:21:27 lukem Exp $"); +__RCSID("$NetBSD: errno.c,v 1.6 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <errno.h> +#include "errno_private.h" + int errno; Index: src/lib/libc/gen/execl.c diff -u src/lib/libc/gen/execl.c:1.17 src/lib/libc/gen/execl.c:1.18 --- src/lib/libc/gen/execl.c:1.17 Thu Jun 30 15:46:07 2011 +++ src/lib/libc/gen/execl.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: execl.c,v 1.17 2011/06/30 19:46:07 joerg Exp $ */ +/* $NetBSD: execl.c,v 1.18 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: execl.c,v 1.17 2011/06/30 19:46:07 joerg Exp $"); +__RCSID("$NetBSD: execl.c,v 1.18 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -44,14 +44,13 @@ __RCSID("$NetBSD: execl.c,v 1.17 2011/06 #include <stdlib.h> #include <unistd.h> #include "reentrant.h" +#include "extern.h" #ifdef __weak_alias __weak_alias(execl,_execl) #endif -extern char **environ; - int execl(const char *name, const char *arg, ...) { Index: src/lib/libc/gen/pthread_atfork.c diff -u src/lib/libc/gen/pthread_atfork.c:1.17 src/lib/libc/gen/pthread_atfork.c:1.18 --- src/lib/libc/gen/pthread_atfork.c:1.17 Tue Sep 13 06:18:47 2022 +++ src/lib/libc/gen/pthread_atfork.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_atfork.c,v 1.17 2022/09/13 10:18:47 riastradh Exp $ */ +/* $NetBSD: pthread_atfork.c,v 1.18 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pthread_atfork.c,v 1.17 2022/09/13 10:18:47 riastradh Exp $"); +__RCSID("$NetBSD: pthread_atfork.c,v 1.18 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -48,9 +48,6 @@ __weak_alias(pthread_atfork, _pthread_at __weak_alias(fork, _fork) #endif /* __weak_alias */ -pid_t __fork(void); /* XXX */ -pid_t __locked_fork(int *) __weak; /* XXX */ - pid_t __locked_fork(int *my_errno) { Index: src/lib/libc/gen/execv.c diff -u src/lib/libc/gen/execv.c:1.10 src/lib/libc/gen/execv.c:1.11 --- src/lib/libc/gen/execv.c:1.10 Mon Jun 25 18:32:43 2012 +++ src/lib/libc/gen/execv.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: execv.c,v 1.10 2012/06/25 22:32:43 abs Exp $ */ +/* $NetBSD: execv.c,v 1.11 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,20 +34,19 @@ #if 0 static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: execv.c,v 1.10 2012/06/25 22:32:43 abs Exp $"); +__RCSID("$NetBSD: execv.c,v 1.11 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include "namespace.h" #include <unistd.h> #include "reentrant.h" +#include "extern.h" #ifdef __weak_alias __weak_alias(execv,_execv) #endif -extern char **environ; - int execv(const char *name, char * const *argv) { Index: src/lib/libc/gen/execvp.c diff -u src/lib/libc/gen/execvp.c:1.31 src/lib/libc/gen/execvp.c:1.32 --- src/lib/libc/gen/execvp.c:1.31 Fri Sep 26 15:28:03 2014 +++ src/lib/libc/gen/execvp.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: execvp.c,v 1.31 2014/09/26 19:28:03 christos Exp $ */ +/* $NetBSD: execvp.c,v 1.32 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: execvp.c,v 1.31 2014/09/26 19:28:03 christos Exp $"); +__RCSID("$NetBSD: execvp.c,v 1.32 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -48,6 +48,7 @@ __RCSID("$NetBSD: execvp.c,v 1.31 2014/0 #include <unistd.h> #include <paths.h> #include "reentrant.h" +#include "extern.h" #ifdef __weak_alias __weak_alias(execvp,_execvp) @@ -153,8 +154,6 @@ done: return (-1); } -extern char **environ; - int execvp(const char *name, char * const *argv) { Index: src/lib/libc/gen/getdevmajor.c diff -u src/lib/libc/gen/getdevmajor.c:1.6 src/lib/libc/gen/getdevmajor.c:1.7 --- src/lib/libc/gen/getdevmajor.c:1.6 Tue Mar 13 17:13:35 2012 +++ src/lib/libc/gen/getdevmajor.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getdevmajor.c,v 1.6 2012/03/13 21:13:35 christos Exp $ */ +/* $NetBSD: getdevmajor.c,v 1.7 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getdevmajor.c,v 1.6 2012/03/13 21:13:35 christos Exp $"); +__RCSID("$NetBSD: getdevmajor.c,v 1.7 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -46,6 +46,7 @@ __RCSID("$NetBSD: getdevmajor.c,v 1.6 20 #include <errno.h> #include <string.h> #include <stdlib.h> +#include "getdevmajor_private.h" #ifdef __weak_alias __weak_alias(getdevmajor,_getdevmajor) @@ -55,7 +56,6 @@ __weak_alias(getdevmajor,_getdevmajor) * XXX temporary alias because getdevmajor() was renamed * in -current for some time */ -dev_t __getdevmajor50(const char *, mode_t); dev_t __getdevmajor50(const char *name, mode_t type) { Index: src/lib/libc/gen/getlogin.c diff -u src/lib/libc/gen/getlogin.c:1.16 src/lib/libc/gen/getlogin.c:1.17 --- src/lib/libc/gen/getlogin.c:1.16 Sat Oct 5 15:19:51 2019 +++ src/lib/libc/gen/getlogin.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getlogin.c,v 1.16 2019/10/05 19:19:51 uwe Exp $ */ +/* $NetBSD: getlogin.c,v 1.17 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ #if 0 static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: getlogin.c,v 1.16 2019/10/05 19:19:51 uwe Exp $"); +__RCSID("$NetBSD: getlogin.c,v 1.17 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -81,7 +81,7 @@ __weak_alias(getlogin_r,_getlogin_r) __weak_alias(setlogin,_setlogin) #endif -int __logname_valid; /* known to setlogin() */ +static int __logname_valid; /* known to setlogin() */ static char logname[MAXLOGNAME + 1]; #ifdef _REENTRANT Index: src/lib/libc/gen/getpwent.c diff -u src/lib/libc/gen/getpwent.c:1.83 src/lib/libc/gen/getpwent.c:1.84 --- src/lib/libc/gen/getpwent.c:1.83 Tue Apr 19 16:32:15 2022 +++ src/lib/libc/gen/getpwent.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getpwent.c,v 1.83 2022/04/19 20:32:15 rillig Exp $ */ +/* $NetBSD: getpwent.c,v 1.84 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1997-2000, 2004-2005 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ #if 0 static char sccsid[] = "@(#)getpwent.c 8.2 (Berkeley) 4/27/95"; #else -__RCSID("$NetBSD: getpwent.c,v 1.83 2022/04/19 20:32:15 rillig Exp $"); +__RCSID("$NetBSD: getpwent.c,v 1.84 2024/01/20 14:52:47 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -111,6 +111,7 @@ __RCSID("$NetBSD: getpwent.c,v 1.83 2022 #include <string.h> #include <syslog.h> #include <unistd.h> +#include "pw_private.h" #ifdef HESIOD #include <hesiod.h> Index: src/lib/libc/gen/humanize_number.c diff -u src/lib/libc/gen/humanize_number.c:1.18 src/lib/libc/gen/humanize_number.c:1.19 --- src/lib/libc/gen/humanize_number.c:1.18 Mon Mar 11 11:10:51 2019 +++ src/lib/libc/gen/humanize_number.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: humanize_number.c,v 1.18 2019/03/11 15:10:51 kre Exp $ */ +/* $NetBSD: humanize_number.c,v 1.19 2024/01/20 14:52:47 christos Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: humanize_number.c,v 1.18 2019/03/11 15:10:51 kre Exp $"); +__RCSID("$NetBSD: humanize_number.c,v 1.19 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -133,8 +133,9 @@ humanize_number(char *buf, size_t len, i if (len - baselen > 19) i = 0; else { + size_t j; /* See if there are additional columns to be used. */ - for (max = 100, i = len - baselen; i-- > 0;) + for (max = 100, j = len - baselen; j-- > 0;) max *= 10; /* Index: src/lib/libc/gen/sysctlgetmibinfo.c diff -u src/lib/libc/gen/sysctlgetmibinfo.c:1.15 src/lib/libc/gen/sysctlgetmibinfo.c:1.16 --- src/lib/libc/gen/sysctlgetmibinfo.c:1.15 Tue Apr 19 16:32:15 2022 +++ src/lib/libc/gen/sysctlgetmibinfo.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctlgetmibinfo.c,v 1.15 2022/04/19 20:32:15 rillig Exp $ */ +/* $NetBSD: sysctlgetmibinfo.c,v 1.16 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.15 2022/04/19 20:32:15 rillig Exp $"); +__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.16 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifndef RUMP_ACTION @@ -84,11 +84,6 @@ static void free_children(struct sysctln static void relearnhead(void); /* - * specifically not static since sysctl(8) "borrows" it. - */ -int __learn_tree(int *, u_int, struct sysctlnode *); - -/* * for ordering nodes -- a query may or may not be given them in * numeric order */ Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.86 src/lib/libc/gen/vis.c:1.87 --- src/lib/libc/gen/vis.c:1.86 Sun Aug 13 11:20:37 2023 +++ src/lib/libc/gen/vis.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.86 2023/08/13 15:20:37 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.87 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.86 2023/08/13 15:20:37 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.87 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -404,7 +404,8 @@ istrsenvisx(char **mbdstp, size_t *dlen, uint64_t bmsk, wmsk; wint_t c; visfun_t f; - int clen = 0, cerr, error = -1, i, shft; + int cerr, error = -1, i, shft; + ssize_t clen = 0; char *mbdst, *mbwrite, *mdst; size_t mbslength; size_t maxolen; @@ -478,7 +479,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, while (mbslength > 0) { /* Convert one multibyte character to wchar_t. */ if (!cerr) { - clen = mbrtowc(src, mbsrc, + clen = (ssize_t)mbrtowc(src, mbsrc, (mbslength < MB_LEN_MAX ? mbslength : MB_LEN_MAX), @@ -598,7 +599,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, mbwrite = mbdst; else mbwrite = mbbuf; - clen = wcrtomb(mbwrite, *dst, &mbstate); + clen = (ssize_t)wcrtomb(mbwrite, *dst, &mbstate); if (clen > 0 && mbwrite != mbdst) { /* * Don't break past our output limit, noting Index: src/lib/libc/hash/md2/md2.c diff -u src/lib/libc/hash/md2/md2.c:1.7 src/lib/libc/hash/md2/md2.c:1.8 --- src/lib/libc/hash/md2/md2.c:1.7 Mon Jun 25 18:32:44 2012 +++ src/lib/libc/hash/md2/md2.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: md2.c,v 1.7 2012/06/25 22:32:44 abs Exp $ */ +/* $NetBSD: md2.c,v 1.8 2024/01/20 14:52:47 christos Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: md2.c,v 1.7 2012/06/25 22:32:44 abs Exp $"); +__RCSID("$NetBSD: md2.c,v 1.8 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -96,12 +96,6 @@ static const unsigned char *pad[] = { "\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020" }; -/* - * XXX This should not be visible, but due to an accident, it is - * XXX so it must remain so. - */ -/*static*/ void MD2Transform __P((MD2_CTX *)); - #ifdef __weak_alias __weak_alias(MD2Init,_MD2Init) __weak_alias(MD2Update,_MD2Update) @@ -161,6 +155,10 @@ MD2Final(unsigned char digest[16], MD2_C MD2Init(context); } +/* + * XXX This should not be visible, but due to an accident, it is + * XXX so it must remain so. + */ /*static*/ void MD2Transform(MD2_CTX *context) { Index: src/lib/libc/inet/inet_cidr_pton.c diff -u src/lib/libc/inet/inet_cidr_pton.c:1.9 src/lib/libc/inet/inet_cidr_pton.c:1.10 --- src/lib/libc/inet/inet_cidr_pton.c:1.9 Thu Dec 13 03:42:26 2018 +++ src/lib/libc/inet/inet_cidr_pton.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: inet_cidr_pton.c,v 1.9 2018/12/13 08:42:26 maya Exp $ */ +/* $NetBSD: inet_cidr_pton.c,v 1.10 2024/01/20 14:52:47 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -22,7 +22,7 @@ #if 0 static const char rcsid[] = "Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp"; #else -__RCSID("$NetBSD: inet_cidr_pton.c,v 1.9 2018/12/13 08:42:26 maya Exp $"); +__RCSID("$NetBSD: inet_cidr_pton.c,v 1.10 2024/01/20 14:52:47 christos Exp $"); #endif #endif @@ -76,12 +76,12 @@ int inet_cidr_pton(int af, const char *src, void *dst, int *bits) { switch (af) { case AF_INET: - return (inet_cidr_pton_ipv4(src, dst, bits, 0)); + return inet_cidr_pton_ipv4(src, dst, bits, 0); case AF_INET6: - return (inet_cidr_pton_ipv6(src, dst, bits)); + return inet_cidr_pton_ipv6(src, dst, bits); default: errno = EAFNOSUPPORT; - return (-1); + return -1; } } @@ -144,15 +144,15 @@ inet_cidr_pton_ipv4(const char *src, u_c *dst++ = 0; *pbits = bits; - return (0); + return 0; enoent: errno = ENOENT; - return (-1); + return -1; emsgsize: errno = EMSGSIZE; - return (-1); + return -1; } static int @@ -171,7 +171,7 @@ inet_cidr_pton_ipv6(const char *src, u_c /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') - return (0); + return 0; curtok = src; saw_xdigit = 0; val = 0; @@ -185,7 +185,7 @@ inet_cidr_pton_ipv6(const char *src, u_c val <<= 4; val |= (int)(pch - xdigits); if (val > 0xffff) - return (0); + return 0; saw_xdigit = 1; continue; } @@ -193,14 +193,14 @@ inet_cidr_pton_ipv6(const char *src, u_c curtok = src; if (!saw_xdigit) { if (colonp) - return (0); + return 0; colonp = tp; continue; } else if (*src == '\0') { - return (0); + return 0; } if (tp + NS_INT16SZ > endp) - return (0); + return 0; *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; saw_xdigit = 0; @@ -247,38 +247,37 @@ inet_cidr_pton_ipv6(const char *src, u_c memcpy(dst, tmp, NS_IN6ADDRSZ); *pbits = bits; - return (0); + return 0; enoent: errno = ENOENT; - return (-1); + return -1; emsgsize: errno = EMSGSIZE; - return (-1); + return -1; } static int getbits(const char *src, int ipv6) { int bits = 0; - char *cp, ch; if (*src == '\0') /*%< syntax */ - return (-2); + return -2; do { - ch = *src++; - cp = strchr(digits, ch); + char ch = *src++; + const char *cp = strchr(digits, ch); if (cp == NULL) /*%< syntax */ - return (-2); + return -2; bits *= 10; bits += (int)(cp - digits); if (bits == 0 && *src != '\0') /*%< no leading zeros */ - return (-2); + return -2; if (bits > (ipv6 ? 128 : 32)) /*%< range error */ - return (-2); + return -2; } while (*src != '\0'); - return (bits); + return bits; } /*! \file */ Index: src/lib/libc/isc/Makefile.inc diff -u src/lib/libc/isc/Makefile.inc:1.1 src/lib/libc/isc/Makefile.inc:1.2 --- src/lib/libc/isc/Makefile.inc:1.1 Thu May 20 15:52:14 2004 +++ src/lib/libc/isc/Makefile.inc Sat Jan 20 09:52:47 2024 @@ -1,6 +1,8 @@ -# $NetBSD: Makefile.inc,v 1.1 2004/05/20 19:52:14 christos Exp $ +# $NetBSD: Makefile.inc,v 1.2 2024/01/20 14:52:47 christos Exp $ # net sources .PATH: ${.CURDIR}/isc SRCS+= assertions.c ev_timers.c ev_streams.c + +LINTFLAGS.ev_timers.c += -X 193 # XXX: lint is wrong Index: src/lib/libc/locale/__mb_cur_max.c diff -u src/lib/libc/locale/__mb_cur_max.c:1.2 src/lib/libc/locale/__mb_cur_max.c:1.3 --- src/lib/libc/locale/__mb_cur_max.c:1.2 Wed Jan 24 20:25:06 2001 +++ src/lib/libc/locale/__mb_cur_max.c Sat Jan 20 09:52:47 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: __mb_cur_max.c,v 1.2 2001/01/25 01:25:06 itojun Exp $ */ +/* $NetBSD: __mb_cur_max.c,v 1.3 2024/01/20 14:52:47 christos Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -28,11 +28,13 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: __mb_cur_max.c,v 1.2 2001/01/25 01:25:06 itojun Exp $"); +__RCSID("$NetBSD: __mb_cur_max.c,v 1.3 2024/01/20 14:52:47 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <limits.h> +#include <stdlib.h> +#include "setlocale_local.h" size_t __mb_cur_max = 1; size_t __mb_len_max_runtime = MB_LEN_MAX; Index: src/lib/libc/locale/generic_lc_all.c diff -u src/lib/libc/locale/generic_lc_all.c:1.6 src/lib/libc/locale/generic_lc_all.c:1.7 --- src/lib/libc/locale/generic_lc_all.c:1.6 Thu Jan 4 15:57:29 2018 +++ src/lib/libc/locale/generic_lc_all.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: generic_lc_all.c,v 1.6 2018/01/04 20:57:29 kamil Exp $ */ +/* $NetBSD: generic_lc_all.c,v 1.7 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: generic_lc_all.c,v 1.6 2018/01/04 20:57:29 kamil Exp $"); +__RCSID("$NetBSD: generic_lc_all.c,v 1.7 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -65,7 +65,7 @@ _generic_LC_ALL_setlocale(const char * _ if (name != NULL) { strlcpy(&head[0], name, sizeof(head)); tokens[1] = &head[0]; - tail = strchr(tokens[1], '/'); + tail = __UNCONST(strchr(tokens[1], '/')); if (tail == NULL) { for (i = 2; i < _LC_LAST; ++i) tokens[i] = tokens[1]; @@ -73,13 +73,13 @@ _generic_LC_ALL_setlocale(const char * _ *tail++ = '\0'; for (i = 2; i < _LC_LAST - 1; ++i) { tokens[i] = (const char *)tail; - tail = strchr(tokens[i], '/'); + tail = __UNCONST(strchr(tokens[i], '/')); if (tail == NULL) return NULL; *tail++ = '\0'; } tokens[_LC_LAST - 1] = (const char *)tail; - tail = strchr(tokens[i], '/'); + tail = __UNCONST(strchr(tokens[i], '/')); if (tail != NULL) return NULL; } Index: src/lib/libc/locale/newlocale.c diff -u src/lib/libc/locale/newlocale.c:1.4 src/lib/libc/locale/newlocale.c:1.5 --- src/lib/libc/locale/newlocale.c:1.4 Sun Apr 16 16:37:59 2023 +++ src/lib/libc/locale/newlocale.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: newlocale.c,v 1.4 2023/04/16 20:37:59 mlelstv Exp $ */ +/* $NetBSD: newlocale.c,v 1.5 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c)2008, 2011 Citrus Project, @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: newlocale.c,v 1.4 2023/04/16 20:37:59 mlelstv Exp $"); +__RCSID("$NetBSD: newlocale.c,v 1.5 2024/01/20 14:52:48 christos Exp $"); #include "namespace.h" #include <assert.h> @@ -62,7 +62,7 @@ newlocale(int mask, const char *name, lo return (locale_t)NULL; } tokens[0] = (const char *)&head[0]; - tail = strchr(tokens[0], '/'); + tail = __UNCONST(strchr(tokens[0], '/')); if (tail == NULL) { for (i = 1; i < _LC_LAST; ++i) { if (mask & (1 << i)) { @@ -82,7 +82,7 @@ newlocale(int mask, const char *name, lo for (i = 1; i < howmany; ++i) { *tail++ = '\0'; tokens[i] = (const char *)tail; - tail = strchr(tokens[i], '/'); + tail = __UNCONST(strchr(tokens[i], '/')); if (tail == NULL) { free(dst); return NULL; @@ -90,7 +90,7 @@ newlocale(int mask, const char *name, lo } *tail++ = '\0'; tokens[howmany] = tail; - tail = strchr(tokens[howmany], '/'); + tail = __UNCONST(strchr(tokens[howmany], '/')); if (tail != NULL) { free(dst); return NULL; Index: src/lib/libc/misc/initfini.c diff -u src/lib/libc/misc/initfini.c:1.16 src/lib/libc/misc/initfini.c:1.17 --- src/lib/libc/misc/initfini.c:1.16 Tue Jul 18 07:44:32 2023 +++ src/lib/libc/misc/initfini.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: initfini.c,v 1.16 2023/07/18 11:44:32 riastradh Exp $ */ +/* $NetBSD: initfini.c,v 1.17 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: initfini.c,v 1.16 2023/07/18 11:44:32 riastradh Exp $"); +__RCSID("$NetBSD: initfini.c,v 1.17 2024/01/20 14:52:48 christos Exp $"); #ifdef _LIBC #include "namespace.h" @@ -40,13 +40,11 @@ __RCSID("$NetBSD: initfini.c,v 1.16 2023 #include <sys/exec.h> #include <sys/tls.h> #include <stdbool.h> +#include "extern.h" #include "csu-common.h" -void _libc_init(void) __attribute__((__constructor__, __used__)); - void __guard_setup(void); void __libc_thr_init(void); -void __libc_atomic_init(void); void __libc_atexit_init(void); void __libc_env_init(void); @@ -70,8 +68,6 @@ ___dlauxinfo(void) static bool libc_initialised; -void _libc_init(void); - /* * Declare as common symbol to allow new libc with older binaries to * not trigger an undefined reference. Index: src/lib/libc/nameser/ns_name.c diff -u src/lib/libc/nameser/ns_name.c:1.13 src/lib/libc/nameser/ns_name.c:1.14 --- src/lib/libc/nameser/ns_name.c:1.13 Mon Jun 19 04:40:29 2023 +++ src/lib/libc/nameser/ns_name.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ns_name.c,v 1.13 2023/06/19 08:40:29 msaitoh Exp $ */ +/* $NetBSD: ns_name.c,v 1.14 2024/01/20 14:52:48 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -22,7 +22,7 @@ #ifdef notdef static const char rcsid[] = "Id: ns_name.c,v 1.11 2009/01/23 19:59:16 each Exp"; #else -__RCSID("$NetBSD: ns_name.c,v 1.13 2023/06/19 08:40:29 msaitoh Exp $"); +__RCSID("$NetBSD: ns_name.c,v 1.14 2024/01/20 14:52:48 christos Exp $"); #endif #endif @@ -227,7 +227,7 @@ int ns_name_pton2(const char *src, u_char *dst, size_t dstsiz, size_t *dstlen) { u_char *label, *bp, *eom; int c, n, escaped, e = 0; - char *cp; + const char *cp; escaped = 0; bp = dst; Index: src/lib/libc/net/base64.c diff -u src/lib/libc/net/base64.c:1.16 src/lib/libc/net/base64.c:1.17 --- src/lib/libc/net/base64.c:1.16 Mon Nov 24 10:43:21 2014 +++ src/lib/libc/net/base64.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: base64.c,v 1.16 2014/11/24 15:43:21 christos Exp $ */ +/* $NetBSD: base64.c,v 1.17 2024/01/20 14:52:48 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -47,7 +47,7 @@ #if 0 static const char rcsid[] = "Id: base64.c,v 1.4 2005/04/27 04:56:34 sra Exp"; #else -__RCSID("$NetBSD: base64.c,v 1.16 2014/11/24 15:43:21 christos Exp $"); +__RCSID("$NetBSD: base64.c,v 1.17 2024/01/20 14:52:48 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -219,7 +219,7 @@ b64_pton(char const *src, u_char *target size_t tarindex; int state, ch; u_char nextbyte; - char *pos; + const char *pos; _DIAGASSERT(src != NULL); _DIAGASSERT(target != NULL); Index: src/lib/libc/net/getaddrinfo.c diff -u src/lib/libc/net/getaddrinfo.c:1.124 src/lib/libc/net/getaddrinfo.c:1.125 --- src/lib/libc/net/getaddrinfo.c:1.124 Tue Aug 1 04:47:25 2023 +++ src/lib/libc/net/getaddrinfo.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getaddrinfo.c,v 1.124 2023/08/01 08:47:25 mrg Exp $ */ +/* $NetBSD: getaddrinfo.c,v 1.125 2024/01/20 14:52:48 christos Exp $ */ /* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */ /* @@ -55,7 +55,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getaddrinfo.c,v 1.124 2023/08/01 08:47:25 mrg Exp $"); +__RCSID("$NetBSD: getaddrinfo.c,v 1.125 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifndef RUMP_ACTION @@ -1393,7 +1393,8 @@ explore_numeric_scope(const struct addri const struct afd *afd; struct addrinfo *cur; int error; - char *cp, *hostname2 = NULL, *scope, *addr; + char *hostname2 = NULL, *addr; + const char *cp, *scope; struct sockaddr_in6 *sin6; _DIAGASSERT(pai != NULL); @@ -1439,7 +1440,8 @@ explore_numeric_scope(const struct addri if (cur->ai_family != AF_INET6) continue; sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr; - if (ip6_str2scopeid(scope, sin6, &scopeid) == -1) { + if (ip6_str2scopeid(__UNCONST(scope), sin6, &scopeid) + == -1) { free(hostname2); return EAI_NODATA; /* XXX: is return OK? */ } Index: src/lib/libc/net/getprotobyname.c diff -u src/lib/libc/net/getprotobyname.c:1.4 src/lib/libc/net/getprotobyname.c:1.5 --- src/lib/libc/net/getprotobyname.c:1.4 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/net/getprotobyname.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobyname.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: getprotobyname.c,v 1.5 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getprotobyname.c,v 1.4 2008/04/28 20:23:00 martin Exp $"); +__RCSID("$NetBSD: getprotobyname.c,v 1.5 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -44,11 +44,6 @@ __RCSID("$NetBSD: getprotobyname.c,v 1.4 __weak_alias(getprotobyname,_getprotobyname) #endif -#ifdef _REENTRANT -extern mutex_t _protoent_mutex; -#endif -extern struct protoent_data _protoent_data; - struct protoent * getprotobyname(const char *name) { Index: src/lib/libc/net/getprotobynumber.c diff -u src/lib/libc/net/getprotobynumber.c:1.4 src/lib/libc/net/getprotobynumber.c:1.5 --- src/lib/libc/net/getprotobynumber.c:1.4 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/net/getprotobynumber.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getprotobynumber.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: getprotobynumber.c,v 1.5 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getprotobynumber.c,v 1.4 2008/04/28 20:23:00 martin Exp $"); +__RCSID("$NetBSD: getprotobynumber.c,v 1.5 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -45,11 +45,6 @@ __RCSID("$NetBSD: getprotobynumber.c,v 1 __weak_alias(getprotobynumber,_getprotobynumber) #endif -#ifdef _REENTRANT -extern mutex_t _protoent_mutex; -#endif -extern struct protoent_data _protoent_data; - struct protoent * getprotobynumber(int proto) { Index: src/lib/libc/net/servent.h diff -u src/lib/libc/net/servent.h:1.4 src/lib/libc/net/servent.h:1.5 --- src/lib/libc/net/servent.h:1.4 Sat Apr 24 20:54:46 2010 +++ src/lib/libc/net/servent.h Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: servent.h,v 1.4 2010/04/25 00:54:46 joerg Exp $ */ +/* $NetBSD: servent.h,v 1.5 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,6 +30,9 @@ */ #include <stdio.h> +#ifdef _REENTRANT +#include "reentrant.h" +#endif struct servent_data { FILE *plainfile; @@ -49,6 +52,11 @@ struct servent_data { void *dummy; }; +#ifdef _REENTRANT +extern mutex_t _servent_mutex; +#endif +extern struct servent_data _servent_data; + struct servent *getservent_r(struct servent *, struct servent_data *); struct servent *getservbyname_r(const char *, const char *, struct servent *, struct servent_data *); Index: src/lib/libc/net/getservbyname.c diff -u src/lib/libc/net/getservbyname.c:1.14 src/lib/libc/net/getservbyname.c:1.15 --- src/lib/libc/net/getservbyname.c:1.14 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/net/getservbyname.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyname.c,v 1.14 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: getservbyname.c,v 1.15 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getservbyname.c,v 1.14 2008/04/28 20:23:00 martin Exp $"); +__RCSID("$NetBSD: getservbyname.c,v 1.15 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -44,11 +44,6 @@ __RCSID("$NetBSD: getservbyname.c,v 1.14 __weak_alias(getservbyname,_getservbyname) #endif -#ifdef _REENTRANT -extern mutex_t _servent_mutex; -#endif -extern struct servent_data _servent_data; - struct servent * getservbyname(const char *name, const char *proto) { Index: src/lib/libc/net/getservbyport.c diff -u src/lib/libc/net/getservbyport.c:1.12 src/lib/libc/net/getservbyport.c:1.13 --- src/lib/libc/net/getservbyport.c:1.12 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/net/getservbyport.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getservbyport.c,v 1.12 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: getservbyport.c,v 1.13 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getservbyport.c,v 1.12 2008/04/28 20:23:00 martin Exp $"); +__RCSID("$NetBSD: getservbyport.c,v 1.13 2024/01/20 14:52:48 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -45,11 +45,6 @@ __RCSID("$NetBSD: getservbyport.c,v 1.12 __weak_alias(getservbyport,_getservbyport) #endif -#ifdef _REENTRANT -extern mutex_t _servent_mutex; -#endif -extern struct servent_data _servent_data; - struct servent * getservbyport(int port, const char *proto) { Index: src/lib/libc/net/protoent.h diff -u src/lib/libc/net/protoent.h:1.2 src/lib/libc/net/protoent.h:1.3 --- src/lib/libc/net/protoent.h:1.2 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/net/protoent.h Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: protoent.h,v 1.2 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: protoent.h,v 1.3 2024/01/20 14:52:48 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,6 +30,9 @@ */ #include <stdio.h> +#ifdef _REENTRANT +#include "reentrant.h" +#endif struct protoent_data { FILE *fp; @@ -41,6 +44,12 @@ struct protoent_data { void *dummy; }; +#ifdef _REENTRANT +extern mutex_t _protoent_mutex; +#endif + +extern struct protoent_data _protoent_data; + struct protoent *getprotoent_r(struct protoent *, struct protoent_data *); struct protoent *getprotobyname_r(const char *, struct protoent *, struct protoent_data *); Index: src/lib/libc/net/rcmd.c diff -u src/lib/libc/net/rcmd.c:1.72 src/lib/libc/net/rcmd.c:1.73 --- src/lib/libc/net/rcmd.c:1.72 Sun May 22 07:27:33 2022 +++ src/lib/libc/net/rcmd.c Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: rcmd.c,v 1.72 2022/05/22 11:27:33 andvar Exp $ */ +/* $NetBSD: rcmd.c,v 1.73 2024/01/20 14:52:48 christos Exp $ */ /* * Copyright (c) 1983, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #else -__RCSID("$NetBSD: rcmd.c,v 1.72 2022/05/22 11:27:33 andvar Exp $"); +__RCSID("$NetBSD: rcmd.c,v 1.73 2024/01/20 14:52:48 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -370,7 +370,7 @@ rshrcmd(int af, char **ahost, u_int32_t { pid_t pid; int sp[2], ep[2]; - char *p; + const char *p; struct passwd *pw, pwres; char pwbuf[1024]; Index: src/lib/libc/net/sctp_sys_calls.c diff -u src/lib/libc/net/sctp_sys_calls.c:1.1 src/lib/libc/net/sctp_sys_calls.c:1.2 --- src/lib/libc/net/sctp_sys_calls.c:1.1 Thu Aug 2 04:40:48 2018 +++ src/lib/libc/net/sctp_sys_calls.c Sat Jan 20 09:52:48 2024 @@ -1,5 +1,5 @@ /* $KAME: sctp_sys_calls.c,v 1.10 2005/03/06 16:04:16 itojun Exp $ */ -/* $NetBSD: sctp_sys_calls.c,v 1.1 2018/08/02 08:40:48 rjs Exp $ */ +/* $NetBSD: sctp_sys_calls.c,v 1.2 2024/01/20 14:52:48 christos Exp $ */ /* * Copyright (C) 2002, 2003, 2004 Cisco Systems Inc, @@ -146,7 +146,7 @@ sctp_connectx(int sd, struct sockaddr *a if (at->sa_family == AF_INET) { len += at->sa_len; } else if (at->sa_family == AF_INET6){ - if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)at)->sin6_addr)){ + if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)(void *)at)->sin6_addr)){ len += sizeof(struct sockaddr_in); #if 0 in6_sin6_2_sin((struct sockaddr_in *)cpto, @@ -171,7 +171,7 @@ sctp_connectx(int sd, struct sockaddr *a } sca.cx_num = cnt; - sca.cx_len = len; + sca.cx_len = (int)len; sca.cx_addrs = addrs; ret = ioctl(sd, SIOCCONNECTX, (void *)&sca); if ((ret == 0) && (id != NULL)) { @@ -204,7 +204,7 @@ sctp_bindx(int sd, struct sockaddr *addr for (i = 0; i < addrcnt; i++) { sz = sa->sa_len; fam = sa->sa_family; - ((struct sockaddr_in *)&addrs[i])->sin_port = ((struct sockaddr_in *)sa)->sin_port; + ((struct sockaddr_in *)(void *)&addrs[i])->sin_port = ((struct sockaddr_in *)(void *)sa)->sin_port; if ((fam != AF_INET) && (fam != AF_INET6)) { errno = EINVAL; return(-1); @@ -308,7 +308,7 @@ sctp_getladdrs (int sd, sctp_assoc_t id, caddr_t lim; struct sockaddr *sa; int size_of_addresses; - unsigned int siz; + socklen_t siz; int cnt; if (raddrs == NULL) { @@ -325,7 +325,7 @@ sctp_getladdrs (int sd, sctp_assoc_t id, errno = ENOTCONN; return(-1); } - siz = size_of_addresses + sizeof(struct sockaddr_storage); + siz = (socklen_t)(size_of_addresses + sizeof(struct sockaddr_storage)); siz += sizeof(struct sctp_getaddresses); addrs = calloc((unsigned long)1, (unsigned long)siz); if (addrs == NULL) { @@ -375,7 +375,7 @@ sctp_sendmsg(int s, u_int32_t timetolive, u_int32_t context) { - int sz; + ssize_t sz; struct msghdr msg; struct iovec iov[2]; char controlVector[256]; @@ -415,7 +415,7 @@ sctp_sendmsg(int s, } else { memcpy (&addr, to, to->sa_len); } - who = (struct sockaddr *)&addr; + who = (struct sockaddr *)(void *)&addr; } iov[0].iov_base = (void *)(unsigned long)data; iov[0].iov_len = len; @@ -477,7 +477,7 @@ sctp_send(int sd, const void *data, size const struct sctp_sndrcvinfo *sinfo, int flags) { - int sz; + ssize_t sz; struct msghdr msg; struct iovec iov[2]; struct sctp_sndrcvinfo *s_info; @@ -516,7 +516,8 @@ sctp_sendx(int sd, const void *msg, size struct sctp_sndrcvinfo *sinfo, int flags) { - int i, ret, cnt, saved_errno; + int i, cnt, saved_errno; + ssize_t ret; int add_len; struct sockaddr *at; struct sctp_connectx_addrs sca; @@ -545,7 +546,7 @@ sctp_sendx(int sd, const void *msg, size } sca.cx_num = cnt; - sca.cx_len = len; + sca.cx_len = (int)len; sca.cx_addrs = addrs; ret = ioctl(sd, SIOCCONNECTXDEL, (void *)&sca); if (ret != 0) { @@ -873,7 +874,7 @@ sctp_sendv(int sd, switch (addr->sa_family) { case AF_INET: addr_len = (socklen_t) sizeof(struct sockaddr_in); - addr_in = (struct sockaddr_in *)addr; + addr_in = (struct sockaddr_in *)(void *)addr; if (addr_in->sin_len != addr_len) { free(cmsgbuf); errno = EINVAL; @@ -898,7 +899,7 @@ sctp_sendv(int sd, break; case AF_INET6: addr_len = (socklen_t) sizeof(struct sockaddr_in6); - addr_in6 = (struct sockaddr_in6 *)addr; + addr_in6 = (struct sockaddr_in6 *)(void *)addr; if (addr_in6->sin6_len != addr_len) { free(cmsgbuf); errno = EINVAL; Index: src/lib/libc/posix1e/acl_branding.c diff -u src/lib/libc/posix1e/acl_branding.c:1.1 src/lib/libc/posix1e/acl_branding.c:1.2 --- src/lib/libc/posix1e/acl_branding.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_branding.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_branding.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_branding.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_branding.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include <assert.h> @@ -57,7 +57,7 @@ entry2acl(acl_entry_t entry) { acl_t aclp; - aclp = (acl_t)(((long)entry >> _ACL_T_ALIGNMENT_BITS) << _ACL_T_ALIGNMENT_BITS); + aclp = (acl_t)(((unsigned long)entry >> _ACL_T_ALIGNMENT_BITS) << _ACL_T_ALIGNMENT_BITS); return (aclp); } Index: src/lib/libc/posix1e/acl_calc_mask.c diff -u src/lib/libc/posix1e/acl_calc_mask.c:1.1 src/lib/libc/posix1e/acl_calc_mask.c:1.2 --- src/lib/libc/posix1e/acl_calc_mask.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_calc_mask.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_calc_mask.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_calc_mask.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_calc_mask.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include "namespace.h" @@ -99,7 +99,7 @@ acl_calc_mask(acl_t *acl_p) acl_int_new->acl_entry[i].ae_perm & ACL_PERM_BITS; break; case ACL_MASK: - mask_num = i; + mask_num = (int)i; break; } } Index: src/lib/libc/posix1e/acl_copy.c diff -u src/lib/libc/posix1e/acl_copy.c:1.1 src/lib/libc/posix1e/acl_copy.c:1.2 --- src/lib/libc/posix1e/acl_copy.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_copy.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_copy.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_copy.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_copy.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include "namespace.h" @@ -75,6 +75,7 @@ acl_copy_entry(acl_entry_t dest_d, acl_e } ssize_t +/*ARGSUSED*/ acl_copy_ext(void *buf_p, acl_t acl, ssize_t size) { @@ -83,6 +84,7 @@ acl_copy_ext(void *buf_p, acl_t acl, ssi } acl_t +/*ARGSUSED*/ acl_copy_int(const void *buf_p) { Index: src/lib/libc/posix1e/acl_from_text.c diff -u src/lib/libc/posix1e/acl_from_text.c:1.1 src/lib/libc/posix1e/acl_from_text.c:1.2 --- src/lib/libc/posix1e/acl_from_text.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_from_text.c Sat Jan 20 09:52:48 2024 @@ -33,7 +33,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_from_text.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_from_text.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_from_text.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include "namespace.h" @@ -51,9 +51,6 @@ __RCSID("$NetBSD: acl_from_text.c,v 1.1 static acl_tag_t acl_string_to_tag(char *tag, char *qualifier); -int _nfs4_acl_entry_from_text(acl_t aclp, char *entry); -int _text_could_be_nfs4_acl(const char *entry); - static acl_tag_t acl_string_to_tag(char *tag, char *qualifier) { @@ -71,7 +68,7 @@ acl_string_to_tag(char *tag, char *quali if ((!strcmp(tag, "other")) || (!strcmp(tag, "o"))) { return (ACL_OTHER); } else - return(-1); + return((acl_tag_t)-1); } else { if ((!strcmp(tag, "user")) || (!strcmp(tag, "u"))) { return(ACL_USER); @@ -79,7 +76,7 @@ acl_string_to_tag(char *tag, char *quali if ((!strcmp(tag, "group")) || (!strcmp(tag, "g"))) { return(ACL_GROUP); } else - return(-1); + return((acl_tag_t)-1); } } Index: src/lib/libc/posix1e/acl_from_text_nfs4.c diff -u src/lib/libc/posix1e/acl_from_text_nfs4.c:1.1 src/lib/libc/posix1e/acl_from_text_nfs4.c:1.2 --- src/lib/libc/posix1e/acl_from_text_nfs4.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_from_text_nfs4.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_from_text_nfs4.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_from_text_nfs4.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_from_text_nfs4.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include <stdio.h> @@ -91,7 +91,8 @@ parse_tag(const char *str, acl_entry_t e static int parse_qualifier(char *str, acl_entry_t entry, int *need_qualifier) { - int qualifier_length, error; + size_t qualifier_length; + int error; uid_t id; acl_tag_t tag; @@ -169,7 +170,7 @@ parse_entry_type(const char *str, acl_en static int parse_appended_id(char *str, acl_entry_t entry) { - int qualifier_length; + size_t qualifier_length; char *end; id_t id; @@ -181,7 +182,7 @@ parse_appended_id(char *str, acl_entry_t } id = strtod(str, &end); - if (end - str != qualifier_length) { + if ((size_t)(end - str) != qualifier_length) { warnx("malformed ACL: appended id is not a number"); return (-1); } Index: src/lib/libc/posix1e/acl_support.h diff -u src/lib/libc/posix1e/acl_support.h:1.1 src/lib/libc/posix1e/acl_support.h:1.2 --- src/lib/libc/posix1e/acl_support.h:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_support.h Sat Jan 20 09:52:48 2024 @@ -66,5 +66,6 @@ int _posix1e_acl_add_entry(acl_t acl, ac char *string_skip_whitespace(char *string); void string_trim_trailing_whitespace(char *string); int _acl_name_to_id(acl_tag_t tag, char *name, uid_t *id); +int _text_could_be_nfs4_acl(const char *entry); #endif Index: src/lib/libc/posix1e/acl_support_nfs4.c diff -u src/lib/libc/posix1e/acl_support_nfs4.c:1.1 src/lib/libc/posix1e/acl_support_nfs4.c:1.2 --- src/lib/libc/posix1e/acl_support_nfs4.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_support_nfs4.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_support_nfs4.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_support_nfs4.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_support_nfs4.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include <stdio.h> @@ -47,7 +47,7 @@ struct flagnames_struct { char letter; }; -struct flagnames_struct a_flags[] = +static struct flagnames_struct a_flags[] = {{ ACL_ENTRY_FILE_INHERIT, "file_inherit", 'f'}, { ACL_ENTRY_DIRECTORY_INHERIT, "dir_inherit", 'd'}, { ACL_ENTRY_INHERIT_ONLY, "inherit_only", 'i'}, @@ -62,7 +62,7 @@ struct flagnames_struct a_flags[] = */ { 0, 0, 0}}; -struct flagnames_struct a_access_masks[] = +static struct flagnames_struct a_access_masks[] = {{ ACL_READ_DATA, "read_data", 'r'}, { ACL_WRITE_DATA, "write_data", 'w'}, { ACL_EXECUTE, "execute", 'x'}, Index: src/lib/libc/posix1e/acl_to_text_nfs4.c diff -u src/lib/libc/posix1e/acl_to_text_nfs4.c:1.1 src/lib/libc/posix1e/acl_to_text_nfs4.c:1.2 --- src/lib/libc/posix1e/acl_to_text_nfs4.c:1.1 Sat May 16 14:31:47 2020 +++ src/lib/libc/posix1e/acl_to_text_nfs4.c Sat Jan 20 09:52:48 2024 @@ -30,7 +30,7 @@ #if 0 __FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_to_text_nfs4.c 326193 2017-11-25 17:12:48Z pfg $"); #else -__RCSID("$NetBSD: acl_to_text_nfs4.c,v 1.1 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: acl_to_text_nfs4.c,v 1.2 2024/01/20 14:52:48 christos Exp $"); #endif #include <stdio.h> @@ -177,7 +177,7 @@ format_entry(char *str, size_t size, con acl_permset_t permset; acl_flagset_t flagset; int error; - unsigned int len; + size_t len; char buf[MAX_ENTRY_LENGTH + 1]; assert(_entry_brand(entry) == ACL_BRAND_NFS4); @@ -197,7 +197,7 @@ format_entry(char *str, size_t size, con len = strlen(buf); if (len < min_who_field_length) len = min_who_field_length; - off += snprintf(str + off, size - off, "%*s:", len, buf); + off += snprintf(str + off, size - off, "%*s:", (int)len, buf); error = _nfs4_format_access_mask(buf, sizeof(buf), *permset, flags & ACL_TEXT_VERBOSE); @@ -234,7 +234,8 @@ format_entry(char *str, size_t size, con char * _nfs4_acl_to_text_np(const acl_t aclp, ssize_t *len_p, int flags) { - int error, off = 0, size, entry_id = ACL_FIRST_ENTRY; + int error, entry_id = ACL_FIRST_ENTRY; + size_t off = 0, size; char *str; acl_entry_t entry; Index: src/lib/libc/regex/Makefile.inc diff -u src/lib/libc/regex/Makefile.inc:1.9 src/lib/libc/regex/Makefile.inc:1.10 --- src/lib/libc/regex/Makefile.inc:1.9 Thu Jan 14 16:45:01 2016 +++ src/lib/libc/regex/Makefile.inc Sat Jan 20 09:52:48 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.9 2016/01/14 21:45:01 christos Exp $ +# $NetBSD: Makefile.inc,v 1.10 2024/01/20 14:52:48 christos Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # regex sources @@ -12,3 +12,5 @@ MAN+= regex.3 re_format.7 MLINKS+=regex.3 regcomp.3 regex.3 regexec.3 regex.3 regerror.3 \ regex.3 regfree.3 regex.3 regnsub.3 regex.3 regasub.3 + +LINTFLAGS.regexec.c += -X 129,191 Index: src/lib/libc/ssp/ssp_redirect.c diff -u src/lib/libc/ssp/ssp_redirect.c:1.2 src/lib/libc/ssp/ssp_redirect.c:1.3 --- src/lib/libc/ssp/ssp_redirect.c:1.2 Tue Nov 14 22:35:04 2023 +++ src/lib/libc/ssp/ssp_redirect.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ssp_redirect.c,v 1.2 2023/11/15 03:35:04 christos Exp $ */ +/* $NetBSD: ssp_redirect.c,v 1.3 2024/01/20 14:52:49 christos Exp $ */ /*- * Copyright (c) 2023 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #define __ssp_inline #include <sys/cdefs.h> -__RCSID("$NetBSD: ssp_redirect.c,v 1.2 2023/11/15 03:35:04 christos Exp $"); +__RCSID("$NetBSD: ssp_redirect.c,v 1.3 2024/01/20 14:52:49 christos Exp $"); #include <unistd.h> @@ -43,6 +43,7 @@ __RCSID("$NetBSD: ssp_redirect.c,v 1.2 2 * Provide definitions of the redirect functions in libc. */ static int __used +/*LINTED unused*/ __ssp_use(void) { if (getcwd(NULL, 0) == NULL) Index: src/lib/libc/stdio/Makefile.inc diff -u src/lib/libc/stdio/Makefile.inc:1.48 src/lib/libc/stdio/Makefile.inc:1.49 --- src/lib/libc/stdio/Makefile.inc:1.48 Tue Apr 4 15:26:06 2023 +++ src/lib/libc/stdio/Makefile.inc Sat Jan 20 09:52:49 2024 @@ -1,5 +1,5 @@ # from: @(#)Makefile.inc 5.7 (Berkeley) 6/27/91 -# $NetBSD: Makefile.inc,v 1.48 2023/04/04 19:26:06 christos Exp $ +# $NetBSD: Makefile.inc,v 1.49 2024/01/20 14:52:49 christos Exp $ # stdio sources .PATH: ${.CURDIR}/stdio @@ -72,3 +72,7 @@ MLINKS+=printf_l.3 asprintf_l.3 printf_l MLINKS+=scanf_l.3 fscanf_l.3 scanf_l.3 sscanf_l.3 scanf_l.3 vfscanf_l.3 \ scanf_l.3 vscanf_l.3 scanf_l.3 vsscanf_l.3 +LINTFLAGS.vfscanf.c += -X 207 # XXX: lint is wrong +LINTFLAGS.clrerr.c += -X 309 # XXX: lint bogus warning +LINTFLAGS.rewind.c += -X 309 # XXX: lint bogus warning +LINTFLAGS.ungetwc.c += -X 309 # XXX: lint bogus warning Index: src/lib/libc/stdio/fread.c diff -u src/lib/libc/stdio/fread.c:1.26 src/lib/libc/stdio/fread.c:1.27 --- src/lib/libc/stdio/fread.c:1.26 Sun Feb 7 10:54:09 2021 +++ src/lib/libc/stdio/fread.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fread.c,v 1.26 2021/02/07 15:54:09 jdolecek Exp $ */ +/* $NetBSD: fread.c,v 1.27 2024/01/20 14:52:49 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)fread.c 8.2 (Berkeley) 12/11/93"; #else -__RCSID("$NetBSD: fread.c,v 1.26 2021/02/07 15:54:09 jdolecek Exp $"); +__RCSID("$NetBSD: fread.c,v 1.27 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -93,7 +93,7 @@ fread(void *buf, size_t size, size_t cou while (resid > 0) { /* set up the buffer */ fp->_bf._base = fp->_p = (unsigned char *)p; - fp->_bf._size = resid; + fp->_bf._size = (int)resid; if (__srefill(fp)) { /* no more input: return partial result */ Index: src/lib/libc/stdio/gettemp.c diff -u src/lib/libc/stdio/gettemp.c:1.21 src/lib/libc/stdio/gettemp.c:1.22 --- src/lib/libc/stdio/gettemp.c:1.21 Tue Jan 10 12:45:12 2017 +++ src/lib/libc/stdio/gettemp.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: gettemp.c,v 1.21 2017/01/10 17:45:12 christos Exp $ */ +/* $NetBSD: gettemp.c,v 1.22 2024/01/20 14:52:49 christos Exp $ */ /* * Copyright (c) 1987, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: gettemp.c,v 1.21 2017/01/10 17:45:12 christos Exp $"); +__RCSID("$NetBSD: gettemp.c,v 1.22 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -54,7 +54,7 @@ int GETTEMP(char *path, int *doopen, int domkdir, int slen, int oflags) { char *start, *trv, *suffp, *carryp; - char *pad; + const char *pad; struct stat sbuf; int rval; uint32_t r; Index: src/lib/libc/stdio/vfwprintf.c diff -u src/lib/libc/stdio/vfwprintf.c:1.40 src/lib/libc/stdio/vfwprintf.c:1.41 --- src/lib/libc/stdio/vfwprintf.c:1.40 Tue Apr 4 15:26:06 2023 +++ src/lib/libc/stdio/vfwprintf.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: vfwprintf.c,v 1.40 2023/04/04 19:26:06 christos Exp $ */ +/* $NetBSD: vfwprintf.c,v 1.41 2024/01/20 14:52:49 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.27 2007/01/09 00:28:08 imp Exp $"); #else -__RCSID("$NetBSD: vfwprintf.c,v 1.40 2023/04/04 19:26:06 christos Exp $"); +__RCSID("$NetBSD: vfwprintf.c,v 1.41 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -1302,7 +1302,8 @@ fp_common: * NUL in the first `prec' characters, and * STRLEN() will go further. */ - CHAR_T *p = MEMCHR(result, 0, (size_t)prec); + const CHAR_T *p = + MEMCHR(result, 0, (size_t)prec); if (p != NULL) { _DIAGASSERT(__type_fit(int, Index: src/lib/libc/sys/Lint___vfork14.c diff -u src/lib/libc/sys/Lint___vfork14.c:1.3 src/lib/libc/sys/Lint___vfork14.c:1.4 --- src/lib/libc/sys/Lint___vfork14.c:1.3 Sun Jun 24 11:26:03 2012 +++ src/lib/libc/sys/Lint___vfork14.c Sat Jan 20 09:52:49 2024 @@ -1,11 +1,13 @@ -/* $NetBSD: Lint___vfork14.c,v 1.3 2012/06/24 15:26:03 christos Exp $ */ +/* $NetBSD: Lint___vfork14.c,v 1.4 2024/01/20 14:52:49 christos Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ +#define __LIBC12_SOURCE__ #include <unistd.h> +#include <compat/include/unistd.h> /*ARGSUSED*/ pid_t Index: src/lib/libc/sys/Lint_clone.c diff -u src/lib/libc/sys/Lint_clone.c:1.2 src/lib/libc/sys/Lint_clone.c:1.3 --- src/lib/libc/sys/Lint_clone.c:1.2 Sat Jan 18 06:32:58 2003 +++ src/lib/libc/sys/Lint_clone.c Sat Jan 20 09:52:49 2024 @@ -1,10 +1,11 @@ -/* $NetBSD: Lint_clone.c,v 1.2 2003/01/18 11:32:58 thorpej Exp $ */ +/* $NetBSD: Lint_clone.c,v 1.3 2024/01/20 14:52:49 christos Exp $ */ /* * This file placed in the public domain. * Jason R. Thorpe, July 16, 2001. */ +#define _GNU_SOURCE #include <sched.h> /*ARGSUSED*/ Index: src/lib/libc/sys/Lint_ptrace.c diff -u src/lib/libc/sys/Lint_ptrace.c:1.2 src/lib/libc/sys/Lint_ptrace.c:1.3 --- src/lib/libc/sys/Lint_ptrace.c:1.2 Wed Jun 14 02:49:10 2000 +++ src/lib/libc/sys/Lint_ptrace.c Sat Jan 20 09:52:49 2024 @@ -1,19 +1,16 @@ -/* $NetBSD: Lint_ptrace.c,v 1.2 2000/06/14 06:49:10 cgd Exp $ */ +/* $NetBSD: Lint_ptrace.c,v 1.3 2024/01/20 14:52:49 christos Exp $ */ /* * This file placed in the public domain. * Chris Demetriou, November 5, 1997. */ -#include <unistd.h> +#include <sys/types.h> +#include <sys/ptrace.h> /*ARGSUSED*/ int -ptrace(request, pid, addr, data) - int request; - pid_t pid; - caddr_t addr; - int data; +ptrace(int request, pid_t pid, void *addr, int data) { return (0); } Index: src/lib/libc/sys/makelintstub diff -u src/lib/libc/sys/makelintstub:1.27 src/lib/libc/sys/makelintstub:1.28 --- src/lib/libc/sys/makelintstub:1.27 Sat May 16 14:31:47 2020 +++ src/lib/libc/sys/makelintstub Sat Jan 20 09:52:49 2024 @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelintstub,v 1.27 2020/05/16 18:31:47 christos Exp $ +# $NetBSD: makelintstub,v 1.28 2024/01/20 14:52:49 christos Exp $ # # Copyright (c) 1996, 1997 Christopher G. Demetriou # All rights reserved. @@ -84,11 +84,13 @@ header() #include <sys/event.h> #include <sys/uuid.h> #include <sys/quotactl.h> - #ifdef __STDC__ #include <stdarg.h> - #else - #include <varargs.h> - #endif + #include <unistd.h> + #include <stdlib.h> + #include <spawn.h> + #include <fcntl.h> + + #include "extern.h" __EOF__ } Index: src/lib/libc/time/asctime.c diff -u src/lib/libc/time/asctime.c:1.29 src/lib/libc/time/asctime.c:1.30 --- src/lib/libc/time/asctime.c:1.29 Sat Sep 16 14:40:26 2023 +++ src/lib/libc/time/asctime.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: asctime.c,v 1.29 2023/09/16 18:40:26 christos Exp $ */ +/* $NetBSD: asctime.c,v 1.30 2024/01/20 14:52:49 christos Exp $ */ /* asctime and asctime_r a la POSIX and ISO C, except pad years before 1000. */ @@ -18,7 +18,7 @@ #if 0 static char elsieid[] = "@(#)asctime.c 8.5"; #else -__RCSID("$NetBSD: asctime.c,v 1.29 2023/09/16 18:40:26 christos Exp $"); +__RCSID("$NetBSD: asctime.c,v 1.30 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -68,19 +68,19 @@ enum { STD_ASCTIME_BUF_SIZE = 26 }; ** as an example; the size expression below is a bound for the system at ** hand. */ -static char buf_asctime[2*3 + 5*INT_STRLEN_MAXIMUM(int) + 7 + 2 + 1 + 1]; +static char buf_ctime[2*3 + 5*INT_STRLEN_MAXIMUM(int) + 7 + 2 + 1 + 1]; /* A similar buffer for ctime. C89 requires that they be the same buffer. This requirement was removed in C99, so support it only if requested, as support is more likely to lead to bugs in badly written programs. */ +#ifndef __LIBC12_SOURCE__ #if SUPPORT_C89 -# define buf_ctime buf_asctime +# define buf_asctime buf_ctime #else -static char buf_ctime[sizeof buf_asctime]; +static char buf_asctime[sizeof buf_ctime]; #endif -#ifndef __LIBC12_SOURCE__ char * asctime_r(struct tm const *restrict timeptr, char *restrict buf) { @@ -94,7 +94,7 @@ asctime_r(struct tm const *restrict time const char * wn; const char * mn; char year[INT_STRLEN_MAXIMUM(int) + 2]; - char result[sizeof buf_asctime]; + char result[sizeof buf_ctime]; if (timeptr == NULL) { errno = EINVAL; Index: src/lib/libc/time/difftime.c diff -u src/lib/libc/time/difftime.c:1.23 src/lib/libc/time/difftime.c:1.24 --- src/lib/libc/time/difftime.c:1.23 Fri Oct 22 10:26:04 2021 +++ src/lib/libc/time/difftime.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: difftime.c,v 1.23 2021/10/22 14:26:04 christos Exp $ */ +/* $NetBSD: difftime.c,v 1.24 2024/01/20 14:52:49 christos Exp $ */ /* Return the difference between two timestamps. */ @@ -12,7 +12,7 @@ #if 0 static char elsieid[] = "@(#)difftime.c 8.1"; #else -__RCSID("$NetBSD: difftime.c,v 1.23 2021/10/22 14:26:04 christos Exp $"); +__RCSID("$NetBSD: difftime.c,v 1.24 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -45,6 +45,7 @@ difftime(time_t time1, time_t time0) ** if the minuend is greater than or equal to the subtrahend. */ if (!TYPE_SIGNED(time_t)) + /*NOTREACHED*/ return time0 <= time1 ? time1 - time0 : dminus((double)(time0 - time1)); Index: src/lib/libc/time/localtime.c diff -u src/lib/libc/time/localtime.c:1.139 src/lib/libc/time/localtime.c:1.140 --- src/lib/libc/time/localtime.c:1.139 Sat Dec 23 15:48:38 2023 +++ src/lib/libc/time/localtime.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: localtime.c,v 1.139 2023/12/23 20:48:38 christos Exp $ */ +/* $NetBSD: localtime.c,v 1.140 2024/01/20 14:52:49 christos Exp $ */ /* Convert timestamp from time_t to struct tm. */ @@ -12,7 +12,7 @@ #if 0 static char elsieid[] = "@(#)localtime.c 8.17"; #else -__RCSID("$NetBSD: localtime.c,v 1.139 2023/12/23 20:48:38 christos Exp $"); +__RCSID("$NetBSD: localtime.c,v 1.140 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -137,6 +137,7 @@ struct state { __time_t ats[TZ_MAX_TIMES]; unsigned char types[TZ_MAX_TIMES]; struct ttinfo ttis[TZ_MAX_TYPES]; + /*CONSTCOND*/ char chars[max(max(TZ_MAX_CHARS + CHARS_EXTRA, sizeof "UTC"), 2 * (TZNAME_MAXIMUM + 1))]; struct lsinfo lsis[TZ_MAX_LEAPS]; @@ -165,7 +166,7 @@ static struct tm *gmtsub(struct state co struct tm *); static bool increment_overflow(int *, int); static bool increment_overflow_time(__time_t *, int_fast32_t); -static int_fast32_t leapcorr(struct state const *, time_t); +static int_fast32_t leapcorr(struct state const *, __time_t); static bool normalize_overflow32(int_fast32_t *, int *, int); static struct tm *timesub(time_t const *, int_fast32_t, struct state const *, struct tm *); @@ -222,9 +223,6 @@ extern __aconst char * tzname[2]; # if !defined(__LIBC12_SOURCE__) long timezone = 0; int daylight = 0; -# else -extern int daylight; -extern long timezone __RENAME(__timezone13); # endif /* __LIBC12_SOURCE__ */ #endif /* 2<= USG_COMPAT + TZ_TIME_T */ @@ -400,7 +398,7 @@ settzname(void) } #if USG_COMPAT - daylight = stddst_mask >> 1 ^ 1; + daylight = (unsigned int)stddst_mask >> 1 ^ 1; #endif } @@ -414,7 +412,7 @@ scrub_abbrs(struct state *sp) /* Reject overlong abbreviations. */ for (i = 0; i < sp->charcnt - (TZNAME_MAXIMUM + 1); ) { - int len = strlen(&sp->chars[i]); + int len = (int)strlen(&sp->chars[i]); if (TZNAME_MAXIMUM < len) return EOVERFLOW; i += len + 1; @@ -1153,7 +1151,7 @@ tzparse(const char *name, struct state * register char * cp; register bool load_ok; ptrdiff_t stdlen, dstlen, charcnt; - time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN; + __time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN; dstname = NULL; /* XXX gcc */ stdname = name; @@ -1252,7 +1250,7 @@ tzparse(const char *name, struct state * } while (atlo < janfirst && EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg); - while (true) { + for (;;) { int_fast32_t yearsecs = year_lengths[isleap(yearbeg)] * SECSPERDAY; int yearbeg1 = yearbeg; @@ -1526,7 +1524,8 @@ tzalloc(char const *name) errno = err; return NULL; } - } else if (!HAVE_MALLOC_ERRNO) + } else if (/*CONSTCOND*/!HAVE_MALLOC_ERRNO) + /*NOTREACHED*/ errno = ENOMEM; return sp; } @@ -1580,7 +1579,7 @@ localsub(struct state const *sp, time_t if ((sp->goback && t < sp->ats[0]) || (sp->goahead && t > sp->ats[sp->timecnt - 1])) { time_t newt; - register time_t seconds; + register __time_t seconds; register time_t years; if (t < sp->ats[0]) @@ -1842,7 +1841,7 @@ timesub(const time_t *timep, int_fast32_ /* If less than SECSPERMIN, the number of seconds since the most recent positive leap second; otherwise, do not add 1 to localtime tm_sec because of leap seconds. */ - time_t secs_since_posleap = SECSPERMIN; + __time_t secs_since_posleap = SECSPERMIN; corr = 0; i = (sp == NULL) ? 0 : sp->leapcnt; @@ -2237,9 +2236,11 @@ again: && (yourtm.TM_GMTOFF < 0 ? (-SECSPERDAY <= yourtm.TM_GMTOFF && (mytm.TM_GMTOFF <= + /*CONSTCOND*/ (min(INT_FAST32_MAX, LONG_MAX) + yourtm.TM_GMTOFF))) : (yourtm.TM_GMTOFF <= SECSPERDAY + /*CONSTCOND*/ && ((max(INT_FAST32_MIN, LONG_MIN) + yourtm.TM_GMTOFF) <= mytm.TM_GMTOFF)))) { @@ -2495,7 +2496,7 @@ timegm(struct tm *tmp) } static int_fast32_t -leapcorr(struct state const *sp, time_t t) +leapcorr(struct state const *sp, __time_t t) { register struct lsinfo const * lp; register int i; Index: src/lib/libc/time/private.h diff -u src/lib/libc/time/private.h:1.67 src/lib/libc/time/private.h:1.68 --- src/lib/libc/time/private.h:1.67 Sat Dec 23 15:48:38 2023 +++ src/lib/libc/time/private.h Sat Jan 20 09:52:49 2024 @@ -1,6 +1,6 @@ /* Private header for tzdb code. */ -/* $NetBSD: private.h,v 1.67 2023/12/23 20:48:38 christos Exp $ */ +/* $NetBSD: private.h,v 1.68 2024/01/20 14:52:49 christos Exp $ */ #ifndef PRIVATE_H #define PRIVATE_H @@ -60,6 +60,7 @@ #endif #if __STDC_VERSION__ < 202311 +# undef static_assert # define static_assert(cond) extern int static_assert_check[(cond) ? 1 : -1] #endif Index: src/lib/libc/time/strftime.c diff -u src/lib/libc/time/strftime.c:1.52 src/lib/libc/time/strftime.c:1.53 --- src/lib/libc/time/strftime.c:1.52 Sat Sep 16 14:40:26 2023 +++ src/lib/libc/time/strftime.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: strftime.c,v 1.52 2023/09/16 18:40:26 christos Exp $ */ +/* $NetBSD: strftime.c,v 1.53 2024/01/20 14:52:49 christos Exp $ */ /* Convert a broken-down timestamp to a string. */ @@ -35,7 +35,7 @@ static char elsieid[] = "@(#)strftime.c 7.64"; static char elsieid[] = "@(#)strftime.c 8.3"; #else -__RCSID("$NetBSD: strftime.c,v 1.52 2023/09/16 18:40:26 christos Exp $"); +__RCSID("$NetBSD: strftime.c,v 1.53 2024/01/20 14:52:49 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -396,6 +396,7 @@ label: (void)snprintf(buf, sizeof(buf), "%"PRIdMAX, n); } else { + /*LINTED possibly unreached*/ uintmax_t n = mkt; (void)snprintf(buf, sizeof(buf), "%"PRIuMAX, n); Index: src/lib/libc/tls/tls.c diff -u src/lib/libc/tls/tls.c:1.14 src/lib/libc/tls/tls.c:1.15 --- src/lib/libc/tls/tls.c:1.14 Thu Aug 20 11:54:11 2020 +++ src/lib/libc/tls/tls.c Sat Jan 20 09:52:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: tls.c,v 1.14 2020/08/20 15:54:11 riastradh Exp $ */ +/* $NetBSD: tls.c,v 1.15 2024/01/20 14:52:49 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: tls.c,v 1.14 2020/08/20 15:54:11 riastradh Exp $"); +__RCSID("$NetBSD: tls.c,v 1.15 2024/01/20 14:52:49 christos Exp $"); #include "namespace.h" @@ -140,6 +140,7 @@ _rtld_tls_free(struct tls_tcb *tcb) } static int __section(".text.startup") +/*ARGSUSED*/ __libc_static_tls_setup_cb(struct dl_phdr_info *data, size_t len, void *cookie) { const Elf_Phdr *phdr = data->dlpi_phdr; Added files: Index: src/lib/libc/compat/include/errno.h diff -u /dev/null src/lib/libc/compat/include/errno.h:1.1 --- /dev/null Sat Jan 20 09:52:50 2024 +++ src/lib/libc/compat/include/errno.h Sat Jan 20 09:52:46 2024 @@ -0,0 +1,47 @@ +/* $NetBSD: errno.h,v 1.1 2024/01/20 14:52:46 christos Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)errno.h 8.5 (Berkeley) 1/21/94 + */ + +#ifndef _COMPAT_ERRNO_H_ +#define _COMPAT_ERRNO_H_ + +__BEGIN_DECLS +extern const int sys_nerr; +extern const char *const sys_errlist[]; +__END_DECLS + +#endif /* !_COMPAT_ERRNO_H_ */ Index: src/lib/libc/compat/include/extern.h diff -u /dev/null src/lib/libc/compat/include/extern.h:1.1 --- /dev/null Sat Jan 20 09:52:50 2024 +++ src/lib/libc/compat/include/extern.h Sat Jan 20 09:52:46 2024 @@ -0,0 +1,48 @@ +/* $NetBSD: extern.h,v 1.1 2024/01/20 14:52:46 christos Exp $ */ + +/*- + * Copyright (c) 2023 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _COMPAT_EXTERN_H_ +#define _COMPAT_EXTERN_H_ + +#include <stdarg.h> + +struct syslog_data60; +void syslog_ss(int, struct syslog_data60 *, const char *, ...) + __printflike(3, 4); +void vsyslog_ss(int, struct syslog_data60 *, const char *, va_list) + __printflike(3, 0); +void syslogp_ss(int, struct syslog_data60 *, const char *, const char *, + const char *, ...) __printflike(5, 0); +void vsyslogp_ss(int, struct syslog_data60 *, const char *, const char *, + const char *, va_list) __printflike(5, 0); + +int __cmsg_alignbytes(void); + +#endif /* _COMPAT_EXTERN_H_ */ Index: src/lib/libc/compat/include/sched.h diff -u /dev/null src/lib/libc/compat/include/sched.h:1.1 --- /dev/null Sat Jan 20 09:52:50 2024 +++ src/lib/libc/compat/include/sched.h Sat Jan 20 09:52:46 2024 @@ -0,0 +1,47 @@ +/* $NetBSD: sched.h,v 1.1 2024/01/20 14:52:46 christos Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Nathan J. Williams. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _COMPAT_SCHED_H_ +#define _COMPAT_SCHED_H_ + +#include <sys/cdefs.h> +#include <sys/featuretest.h> +#include <sys/sched.h> + +/* Required by POSIX 1003.1, section 13.1, lines 12-13. */ +#include <compat/sys/time.h> + +__BEGIN_DECLS +struct timespec50; +int sched_rr_get_interval(pid_t, struct timespec50 *); +__END_DECLS + +#endif /* _COMPAT_SCHED_H_ */ Index: src/lib/libc/gen/errno_private.h diff -u /dev/null src/lib/libc/gen/errno_private.h:1.1 --- /dev/null Sat Jan 20 09:52:50 2024 +++ src/lib/libc/gen/errno_private.h Sat Jan 20 09:52:47 2024 @@ -0,0 +1,29 @@ +/* $NetBSD: errno_private.h,v 1.1 2024/01/20 14:52:47 christos Exp $ */ + +/*- + * Copyright (c) 2023 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#undef errno +extern int errno; Index: src/lib/libc/gen/getdevmajor_private.h diff -u /dev/null src/lib/libc/gen/getdevmajor_private.h:1.1 --- /dev/null Sat Jan 20 09:52:50 2024 +++ src/lib/libc/gen/getdevmajor_private.h Sat Jan 20 09:52:47 2024 @@ -0,0 +1,4 @@ +/* $NetBSD: getdevmajor_private.h,v 1.1 2024/01/20 14:52:47 christos Exp $ */ + + +dev_t __getdevmajor50(const char *, mode_t);