Module Name: src Committed By: christos Date: Tue Jan 23 17:24:38 UTC 2024
Modified Files: src/lib/libc: Makefile.inc src/lib/libc/resolv: res_data.c res_private.h src/lib/libc/rpc: __rpc_getxid.c auth_unix.c clnt_bcast.c clnt_dg.c clnt_raw.c clnt_vc.c pmap_clnt.c rpc_internal.h rpc_soc.c rpcb_clnt.c svc.c svc_auth.c svc_dg.c svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c xdr_rec.c src/lib/libc/sys: __sigaction_siginfo.c Log Message: fix nested extern warnings To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libc/Makefile.inc cvs rdiff -u -r1.14 -r1.15 src/lib/libc/resolv/res_data.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/resolv/res_private.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/rpc/__rpc_getxid.c cvs rdiff -u -r1.27 -r1.28 src/lib/libc/rpc/auth_unix.c cvs rdiff -u -r1.26 -r1.27 src/lib/libc/rpc/clnt_bcast.c cvs rdiff -u -r1.32 -r1.33 src/lib/libc/rpc/clnt_dg.c cvs rdiff -u -r1.33 -r1.34 src/lib/libc/rpc/clnt_raw.c \ src/lib/libc/rpc/svc_simple.c cvs rdiff -u -r1.28 -r1.29 src/lib/libc/rpc/clnt_vc.c \ src/lib/libc/rpc/svc_run.c cvs rdiff -u -r1.19 -r1.20 src/lib/libc/rpc/pmap_clnt.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/rpc/rpc_internal.h cvs rdiff -u -r1.23 -r1.24 src/lib/libc/rpc/rpc_soc.c cvs rdiff -u -r1.31 -r1.32 src/lib/libc/rpc/rpcb_clnt.c cvs rdiff -u -r1.40 -r1.41 src/lib/libc/rpc/svc.c cvs rdiff -u -r1.18 -r1.19 src/lib/libc/rpc/svc_auth.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/rpc/svc_dg.c \ src/lib/libc/rpc/svc_generic.c cvs rdiff -u -r1.25 -r1.26 src/lib/libc/rpc/svc_raw.c cvs rdiff -u -r1.36 -r1.37 src/lib/libc/rpc/svc_vc.c cvs rdiff -u -r1.39 -r1.40 src/lib/libc/rpc/xdr_rec.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/sys/__sigaction_siginfo.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.21 src/lib/libc/Makefile.inc:1.22 --- src/lib/libc/Makefile.inc:1.21 Sat Jan 20 09:52:45 2024 +++ src/lib/libc/Makefile.inc Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.21 2024/01/20 14:52:45 christos Exp $ +# $NetBSD: Makefile.inc,v 1.22 2024/01/23 17:24:38 christos Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -57,8 +57,6 @@ LINTFLAGS+= -w 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/resolv/res_data.c diff -u src/lib/libc/resolv/res_data.c:1.14 src/lib/libc/resolv/res_data.c:1.15 --- src/lib/libc/resolv/res_data.c:1.14 Sat Oct 24 01:35:37 2009 +++ src/lib/libc/resolv/res_data.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: res_data.c,v 1.14 2009/10/24 05:35:37 christos Exp $ */ +/* $NetBSD: res_data.c,v 1.15 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -22,7 +22,7 @@ #ifdef notdef static const char rcsid[] = "Id: res_data.c,v 1.7 2008/12/11 09:59:00 marka Exp"; #else -__RCSID("$NetBSD: res_data.c,v 1.14 2009/10/24 05:35:37 christos Exp $"); +__RCSID("$NetBSD: res_data.c,v 1.15 2024/01/23 17:24:38 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -117,8 +117,6 @@ res_init(void) { * size as the original res structure, and then copy fields to * it so that we achieve the same initialization */ - extern void *__res_get_old_state(void); - extern void __res_put_old_state(void *); res_state ores = __res_get_old_state(); if (ores->options != 0) Index: src/lib/libc/resolv/res_private.h diff -u src/lib/libc/resolv/res_private.h:1.4 src/lib/libc/resolv/res_private.h:1.5 --- src/lib/libc/resolv/res_private.h:1.4 Thu Sep 30 08:35:55 2021 +++ src/lib/libc/resolv/res_private.h Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: res_private.h,v 1.4 2021/09/30 12:35:55 christos Exp $ */ +/* $NetBSD: res_private.h,v 1.5 2024/01/23 17:24:38 christos Exp $ */ #ifndef res_private_h #define res_private_h @@ -21,6 +21,11 @@ struct __res_state_ext { extern int res_ourserver_p(const res_state, const struct sockaddr *); extern int __res_vinit(res_state, int); +#ifdef COMPAT__RES +extern void *__res_get_old_state(void); +extern void __res_put_old_state(void *); +#endif + #endif Index: src/lib/libc/rpc/__rpc_getxid.c diff -u src/lib/libc/rpc/__rpc_getxid.c:1.3 src/lib/libc/rpc/__rpc_getxid.c:1.4 --- src/lib/libc/rpc/__rpc_getxid.c:1.3 Sat Sep 13 17:27:46 2003 +++ src/lib/libc/rpc/__rpc_getxid.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: __rpc_getxid.c,v 1.3 2003/09/13 21:27:46 itojun Exp $ */ +/* $NetBSD: __rpc_getxid.c,v 1.4 2024/01/23 17:24:38 christos Exp $ */ /* $OpenBSD: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $ */ /* @@ -32,12 +32,13 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: __rpc_getxid.c,v 1.3 2003/09/13 21:27:46 itojun Exp $"); +__RCSID("$NetBSD: __rpc_getxid.c,v 1.4 2024/01/23 17:24:38 christos Exp $"); #endif #include <sys/types.h> #include "namespace.h" +#include "reentrant.h" #include <stdlib.h> #include <randomid.h> Index: src/lib/libc/rpc/auth_unix.c diff -u src/lib/libc/rpc/auth_unix.c:1.27 src/lib/libc/rpc/auth_unix.c:1.28 --- src/lib/libc/rpc/auth_unix.c:1.27 Sat Oct 3 14:31:29 2020 +++ src/lib/libc/rpc/auth_unix.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: auth_unix.c,v 1.27 2020/10/03 18:31:29 christos Exp $ */ +/* $NetBSD: auth_unix.c,v 1.28 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)auth_unix.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: auth_unix.c,v 1.27 2020/10/03 18:31:29 christos Exp $"); +__RCSID("$NetBSD: auth_unix.c,v 1.28 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -66,9 +66,12 @@ __RCSID("$NetBSD: auth_unix.c,v 1.27 202 #include <rpc/types.h> #include <rpc/xdr.h> +#include <rpc/rpc.h> #include <rpc/auth.h> #include <rpc/auth_unix.h> +#include "rpc_internal.h" + #ifdef __weak_alias __weak_alias(authunix_create,_authunix_create) __weak_alias(authunix_create_default,_authunix_create_default) @@ -370,9 +373,6 @@ static const struct auth_ops * authunix_ops(void) { static struct auth_ops ops; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif /* VARIABLES PROTECTED BY ops_lock: ops */ Index: src/lib/libc/rpc/clnt_bcast.c diff -u src/lib/libc/rpc/clnt_bcast.c:1.26 src/lib/libc/rpc/clnt_bcast.c:1.27 --- src/lib/libc/rpc/clnt_bcast.c:1.26 Mon Mar 11 16:19:28 2013 +++ src/lib/libc/rpc/clnt_bcast.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: clnt_bcast.c,v 1.26 2013/03/11 20:19:28 tron Exp $ */ +/* $NetBSD: clnt_bcast.c,v 1.27 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)clnt_bcast.c 1.15 89/04/21 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: clnt_bcast.c,v 1.26 2013/03/11 20:19:28 tron Exp $"); +__RCSID("$NetBSD: clnt_bcast.c,v 1.27 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -56,6 +56,7 @@ __RCSID("$NetBSD: clnt_bcast.c,v 1.26 20 */ #include "namespace.h" +#include "reentrant.h" #include <sys/types.h> #include <sys/socket.h> #include <sys/queue.h> Index: src/lib/libc/rpc/clnt_dg.c diff -u src/lib/libc/rpc/clnt_dg.c:1.32 src/lib/libc/rpc/clnt_dg.c:1.33 --- src/lib/libc/rpc/clnt_dg.c:1.32 Mon Jan 24 04:14:36 2022 +++ src/lib/libc/rpc/clnt_dg.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: clnt_dg.c,v 1.32 2022/01/24 09:14:36 andvar Exp $ */ +/* $NetBSD: clnt_dg.c,v 1.33 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)clnt_dg.c 1.19 89/03/16 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: clnt_dg.c,v 1.32 2022/01/24 09:14:36 andvar Exp $"); +__RCSID("$NetBSD: clnt_dg.c,v 1.33 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -104,7 +104,6 @@ static void clnt_dg_destroy(CLIENT *); static int *dg_fd_locks; #ifdef _REENTRANT #define __rpc_lock_value __isthreaded; -extern mutex_t clnt_fd_lock; static cond_t *dg_cv; #define release_fd_lock(fd, mask) { \ mutex_lock(&clnt_fd_lock); \ @@ -729,7 +728,6 @@ clnt_dg_ops(void) { static struct clnt_ops ops; #ifdef _REENTRANT - extern mutex_t ops_lock; sigset_t mask; #endif sigset_t newmask; Index: src/lib/libc/rpc/clnt_raw.c diff -u src/lib/libc/rpc/clnt_raw.c:1.33 src/lib/libc/rpc/clnt_raw.c:1.34 --- src/lib/libc/rpc/clnt_raw.c:1.33 Fri Nov 6 14:32:08 2015 +++ src/lib/libc/rpc/clnt_raw.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: clnt_raw.c,v 1.33 2015/11/06 19:32:08 christos Exp $ */ +/* $NetBSD: clnt_raw.c,v 1.34 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)clnt_raw.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: clnt_raw.c,v 1.33 2015/11/06 19:32:08 christos Exp $"); +__RCSID("$NetBSD: clnt_raw.c,v 1.34 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -62,15 +62,13 @@ __RCSID("$NetBSD: clnt_raw.c,v 1.33 2015 #include <rpc/rpc.h> #include <rpc/raw.h> +#include "rpc_internal.h" + #ifdef __weak_alias __weak_alias(clntraw_create,_clntraw_create) __weak_alias(clnt_raw_create,_clnt_raw_create) #endif -#ifdef _REENTRANT -extern mutex_t clntraw_lock; -#endif - #define MCALL_MSG_SIZE 24 /* @@ -299,9 +297,6 @@ static struct clnt_ops * clnt_raw_ops(void) { static struct clnt_ops ops; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif /* VARIABLES PROTECTED BY ops_lock: ops */ Index: src/lib/libc/rpc/svc_simple.c diff -u src/lib/libc/rpc/svc_simple.c:1.33 src/lib/libc/rpc/svc_simple.c:1.34 --- src/lib/libc/rpc/svc_simple.c:1.33 Mon Mar 11 16:19:29 2013 +++ src/lib/libc/rpc/svc_simple.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_simple.c,v 1.33 2013/03/11 20:19:29 tron Exp $ */ +/* $NetBSD: svc_simple.c,v 1.34 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -50,7 +50,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: svc_simple.c,v 1.33 2013/03/11 20:19:29 tron Exp $"); +__RCSID("$NetBSD: svc_simple.c,v 1.34 2024/01/23 17:24:38 christos Exp $"); #endif #include "namespace.h" @@ -114,9 +114,6 @@ rpc_reg( struct netconfig *nconf; int done = FALSE; void *handle; -#ifdef _REENTRANT - extern mutex_t proglst_lock; -#endif if (procnum == NULLPROC) { warnx("%s: can't reassign procedure number %u", __func__, @@ -260,9 +257,6 @@ universal(struct svc_req *rqstp, SVCXPRT char *outdata; char *xdrbuf; struct proglst *pl; -#ifdef _REENTRANT - extern mutex_t proglst_lock; -#endif _DIAGASSERT(rqstp != NULL); _DIAGASSERT(transp != NULL); Index: src/lib/libc/rpc/clnt_vc.c diff -u src/lib/libc/rpc/clnt_vc.c:1.28 src/lib/libc/rpc/clnt_vc.c:1.29 --- src/lib/libc/rpc/clnt_vc.c:1.28 Mon Jan 24 04:14:36 2022 +++ src/lib/libc/rpc/clnt_vc.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: clnt_vc.c,v 1.28 2022/01/24 09:14:36 andvar Exp $ */ +/* $NetBSD: clnt_vc.c,v 1.29 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -38,7 +38,7 @@ static char *sccsid = "@(#)clnt_tcp.c 1. static char *sccsid = "@(#)clnt_tcp.c 2.2 88/08/01 4.0 RPCSRC"; static char sccsid[] = "@(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: clnt_vc.c,v 1.28 2022/01/24 09:14:36 andvar Exp $"); +__RCSID("$NetBSD: clnt_vc.c,v 1.29 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -130,7 +130,6 @@ struct ct_data { #ifdef _REENTRANT static int *vc_fd_locks; #define __rpc_lock_value __isthreaded; -extern mutex_t clnt_fd_lock; static cond_t *vc_cv; #define release_fd_lock(fd, mask) { \ mutex_lock(&clnt_fd_lock); \ @@ -758,7 +757,6 @@ clnt_vc_ops(void) { static struct clnt_ops ops; #ifdef _REENTRANT - extern mutex_t ops_lock; sigset_t mask; #endif sigset_t newmask; Index: src/lib/libc/rpc/svc_run.c diff -u src/lib/libc/rpc/svc_run.c:1.28 src/lib/libc/rpc/svc_run.c:1.29 --- src/lib/libc/rpc/svc_run.c:1.28 Tue Jan 10 12:45:27 2017 +++ src/lib/libc/rpc/svc_run.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_run.c,v 1.28 2017/01/10 17:45:27 christos Exp $ */ +/* $NetBSD: svc_run.c,v 1.29 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc_run.c,v 1.28 2017/01/10 17:45:27 christos Exp $"); +__RCSID("$NetBSD: svc_run.c,v 1.29 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -74,9 +74,6 @@ svc_run_select(void) #ifndef RUMP_RPC int probs = 0; #endif -#ifdef _REENTRANT - extern rwlock_t svc_fd_lock; -#endif readfds = NULL; fdsize = 0; @@ -140,9 +137,6 @@ svc_run_poll(void) #ifndef RUMP_RPC int probs = 0; #endif -#ifdef _REENTRANT - extern rwlock_t svc_fd_lock; -#endif fdsize = 0; pfd = NULL; @@ -209,9 +203,6 @@ svc_run(void) void svc_exit(void) { -#ifdef _REENTRANT - extern rwlock_t svc_fd_lock; -#endif rwlock_wrlock(&svc_fd_lock); svc_fdset_zero(); Index: src/lib/libc/rpc/pmap_clnt.c diff -u src/lib/libc/rpc/pmap_clnt.c:1.19 src/lib/libc/rpc/pmap_clnt.c:1.20 --- src/lib/libc/rpc/pmap_clnt.c:1.19 Mon Mar 11 16:19:29 2013 +++ src/lib/libc/rpc/pmap_clnt.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_clnt.c,v 1.19 2013/03/11 20:19:29 tron Exp $ */ +/* $NetBSD: pmap_clnt.c,v 1.20 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: pmap_clnt.c,v 1.19 2013/03/11 20:19:29 tron Exp $"); +__RCSID("$NetBSD: pmap_clnt.c,v 1.20 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -49,7 +49,7 @@ __RCSID("$NetBSD: pmap_clnt.c,v 1.19 201 */ #include "namespace.h" - +#include "reentrant.h" #include <unistd.h> #include <rpc/rpc.h> Index: src/lib/libc/rpc/rpc_internal.h diff -u src/lib/libc/rpc/rpc_internal.h:1.8 src/lib/libc/rpc/rpc_internal.h:1.9 --- src/lib/libc/rpc/rpc_internal.h:1.8 Sat Nov 7 18:09:20 2015 +++ src/lib/libc/rpc/rpc_internal.h Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_internal.h,v 1.8 2015/11/07 23:09:20 christos Exp $ */ +/* $NetBSD: rpc_internal.h,v 1.9 2024/01/23 17:24:38 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -64,5 +64,22 @@ u_int32_t __rpc_getxid(void); extern SVCXPRT **__svc_xports; extern int __svc_maxrec; extern int __svc_flags; +extern int __rpc_lowvers; + +#ifdef _REENTRANT +extern mutex_t authsvc_lock; +extern mutex_t clnt_fd_lock; +extern mutex_t clntraw_lock; +extern mutex_t dupreq_lock; +extern mutex_t loopnconf_lock; +extern mutex_t ops_lock; +extern mutex_t proglst_lock; +extern mutex_t rpcsoc_lock; +extern mutex_t svcraw_lock; +extern mutex_t xprtlist_lock; +extern rwlock_t rpcbaddr_cache_lock; +extern rwlock_t svc_fd_lock; +extern rwlock_t svc_lock; +#endif int __clnt_sigfillset(sigset_t *); Index: src/lib/libc/rpc/rpc_soc.c diff -u src/lib/libc/rpc/rpc_soc.c:1.23 src/lib/libc/rpc/rpc_soc.c:1.24 --- src/lib/libc/rpc/rpc_soc.c:1.23 Fri Nov 13 10:23:17 2015 +++ src/lib/libc/rpc/rpc_soc.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_soc.c,v 1.23 2015/11/13 15:23:17 christos Exp $ */ +/* $NetBSD: rpc_soc.c,v 1.24 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -45,7 +45,7 @@ #if 0 static char sccsid[] = "@(#)rpc_soc.c 1.41 89/05/02 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: rpc_soc.c,v 1.23 2015/11/13 15:23:17 christos Exp $"); +__RCSID("$NetBSD: rpc_soc.c,v 1.24 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -96,10 +96,6 @@ __weak_alias(registerrpc,_registerrpc) __weak_alias(clnt_broadcast,_clnt_broadcast) #endif -#ifdef _REENTRANT -extern mutex_t rpcsoc_lock; -#endif - static CLIENT *clnt_com_create(struct sockaddr_in *, rpcprog_t, rpcvers_t, int *, u_int, u_int, const char *); static SVCXPRT *svc_com_create(int, u_int, u_int, const char *); Index: src/lib/libc/rpc/rpcb_clnt.c diff -u src/lib/libc/rpc/rpcb_clnt.c:1.31 src/lib/libc/rpc/rpcb_clnt.c:1.32 --- src/lib/libc/rpc/rpcb_clnt.c:1.31 Thu Mar 26 07:31:57 2015 +++ src/lib/libc/rpc/rpcb_clnt.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: rpcb_clnt.c,v 1.31 2015/03/26 11:31:57 justin Exp $ */ +/* $NetBSD: rpcb_clnt.c,v 1.32 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)rpcb_clnt.c 1.30 89/06/21 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: rpcb_clnt.c,v 1.31 2015/03/26 11:31:57 justin Exp $"); +__RCSID("$NetBSD: rpcb_clnt.c,v 1.32 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -108,8 +108,6 @@ static int cachesize; #define CLCR_SET_RPCB_TIMEOUT 2 -extern int __rpc_lowvers; - static struct address_cache *check_cache(const char *, const char *); static void delete_cache(struct netbuf *); static void add_cache(const char *, const char *, struct netbuf *, char *); @@ -159,9 +157,6 @@ __rpc_control(int request, void *info) * block all clnt_create's if we are trying to connect to a host that's down, * since the lock will be held all during that time. */ -#ifdef _REENTRANT -extern rwlock_t rpcbaddr_cache_lock; -#endif /* * The routines check_cache(), add_cache(), delete_cache() manage the @@ -438,9 +433,6 @@ local_rpcb(void) CLIENT *client; static struct netconfig *loopnconf; static const char *hostname; -#ifdef _REENTRANT - extern mutex_t loopnconf_lock; -#endif int sock; size_t tsize; struct netbuf nbuf; Index: src/lib/libc/rpc/svc.c diff -u src/lib/libc/rpc/svc.c:1.40 src/lib/libc/rpc/svc.c:1.41 --- src/lib/libc/rpc/svc.c:1.40 Sat Aug 21 19:00:30 2021 +++ src/lib/libc/rpc/svc.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc.c,v 1.40 2021/08/21 23:00:30 andvar Exp $ */ +/* $NetBSD: svc.c,v 1.41 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc.c 2.4 88/08/11 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc.c,v 1.40 2021/08/21 23:00:30 andvar Exp $"); +__RCSID("$NetBSD: svc.c,v 1.41 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -116,11 +116,6 @@ static struct svc_callout { void (*sc_dispatch)(struct svc_req *, SVCXPRT *); } *svc_head; -#ifdef _REENTRANT -extern rwlock_t svc_lock; -extern rwlock_t svc_fd_lock; -#endif - static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *); static void __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock); Index: src/lib/libc/rpc/svc_auth.c diff -u src/lib/libc/rpc/svc_auth.c:1.18 src/lib/libc/rpc/svc_auth.c:1.19 --- src/lib/libc/rpc/svc_auth.c:1.18 Tue Mar 22 17:45:13 2022 +++ src/lib/libc/rpc/svc_auth.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_auth.c,v 1.18 2022/03/22 21:45:13 andvar Exp $ */ +/* $NetBSD: svc_auth.c,v 1.19 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)svc_auth.c 1.26 89/02/07 Copyr 1984 Sun Micro"; #else -__RCSID("$NetBSD: svc_auth.c,v 1.18 2022/03/22 21:45:13 andvar Exp $"); +__RCSID("$NetBSD: svc_auth.c,v 1.19 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -57,6 +57,8 @@ __RCSID("$NetBSD: svc_auth.c,v 1.18 2022 #include <assert.h> #include <stdlib.h> +#include "rpc_internal.h" + #ifdef __weak_alias __weak_alias(svc_auth_reg,_svc_auth_reg) #endif @@ -108,9 +110,6 @@ _authenticate(struct svc_req *rqst, stru int cred_flavor; struct authsvc *asp; enum auth_stat dummy; -#ifdef _REENTRANT - extern mutex_t authsvc_lock; -#endif _DIAGASSERT(rqst != NULL); _DIAGASSERT(msg != NULL); @@ -183,9 +182,6 @@ svc_auth_reg( enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *)) { struct authsvc *asp; -#ifdef _REENTRANT - extern mutex_t authsvc_lock; -#endif switch (cred_flavor) { case AUTH_NULL: Index: src/lib/libc/rpc/svc_dg.c diff -u src/lib/libc/rpc/svc_dg.c:1.17 src/lib/libc/rpc/svc_dg.c:1.18 --- src/lib/libc/rpc/svc_dg.c:1.17 Mon Mar 11 16:19:29 2013 +++ src/lib/libc/rpc/svc_dg.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_dg.c,v 1.17 2013/03/11 20:19:29 tron Exp $ */ +/* $NetBSD: svc_dg.c,v 1.18 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -46,7 +46,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: svc_dg.c,v 1.17 2013/03/11 20:19:29 tron Exp $"); +__RCSID("$NetBSD: svc_dg.c,v 1.18 2024/01/23 17:24:38 christos Exp $"); #endif #include "namespace.h" @@ -318,9 +318,6 @@ svc_dg_ops(SVCXPRT *xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif _DIAGASSERT(xprt != NULL); @@ -408,10 +405,6 @@ struct cl_cache { (xid % (SPARSENESS * ((struct cl_cache *) \ su_data(transp)->su_cache)->uc_size)) -#ifdef _REENTRANT -extern mutex_t dupreq_lock; -#endif - /* * Enable use of the cache. Returns 1 on success, 0 on failure. * Note: there is no disable. Index: src/lib/libc/rpc/svc_generic.c diff -u src/lib/libc/rpc/svc_generic.c:1.17 src/lib/libc/rpc/svc_generic.c:1.18 --- src/lib/libc/rpc/svc_generic.c:1.17 Thu May 29 08:35:45 2014 +++ src/lib/libc/rpc/svc_generic.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_generic.c,v 1.17 2014/05/29 12:35:45 christos Exp $ */ +/* $NetBSD: svc_generic.c,v 1.18 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)svc_generic.c 1.21 89/02/28 Copyr 1988 Sun Micro"; #else -__RCSID("$NetBSD: svc_generic.c,v 1.17 2014/05/29 12:35:45 christos Exp $"); +__RCSID("$NetBSD: svc_generic.c,v 1.18 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -101,9 +101,6 @@ svc_create( SVCXPRT *xprt; struct netconfig *nconf; void *handle; -#ifdef _REENTRANT - extern mutex_t xprtlist_lock; -#endif /* VARIABLES PROTECTED BY xprtlist_lock: xprtlist */ Index: src/lib/libc/rpc/svc_raw.c diff -u src/lib/libc/rpc/svc_raw.c:1.25 src/lib/libc/rpc/svc_raw.c:1.26 --- src/lib/libc/rpc/svc_raw.c:1.25 Fri Nov 6 14:32:08 2015 +++ src/lib/libc/rpc/svc_raw.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_raw.c,v 1.25 2015/11/06 19:32:08 christos Exp $ */ +/* $NetBSD: svc_raw.c,v 1.26 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)svc_raw.c 1.25 89/01/31 Copyr 1984 Sun Micro"; #else -__RCSID("$NetBSD: svc_raw.c,v 1.25 2015/11/06 19:32:08 christos Exp $"); +__RCSID("$NetBSD: svc_raw.c,v 1.26 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -61,6 +61,8 @@ __RCSID("$NetBSD: svc_raw.c,v 1.25 2015/ #include <assert.h> #include <stdlib.h> +#include "rpc_internal.h" + #ifdef __weak_alias __weak_alias(svc_raw_create,_svc_raw_create) #endif @@ -79,10 +81,6 @@ static struct svc_raw_private { char verf_body[MAX_AUTH_BYTES]; } *svc_raw_private; -#ifdef _REENTRANT -extern mutex_t svcraw_lock; -#endif - static enum xprt_stat svc_raw_stat(SVCXPRT *); static bool_t svc_raw_recv(SVCXPRT *, struct rpc_msg *); static bool_t svc_raw_reply(SVCXPRT *, struct rpc_msg *); @@ -240,9 +238,6 @@ svc_raw_ops(SVCXPRT *xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif _DIAGASSERT(xprt != NULL); Index: src/lib/libc/rpc/svc_vc.c diff -u src/lib/libc/rpc/svc_vc.c:1.36 src/lib/libc/rpc/svc_vc.c:1.37 --- src/lib/libc/rpc/svc_vc.c:1.36 Tue Dec 7 17:09:59 2021 +++ src/lib/libc/rpc/svc_vc.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: svc_vc.c,v 1.36 2021/12/07 22:09:59 andvar Exp $ */ +/* $NetBSD: svc_vc.c,v 1.37 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: svc_vc.c,v 1.36 2021/12/07 22:09:59 andvar Exp $"); +__RCSID("$NetBSD: svc_vc.c,v 1.37 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -78,10 +78,6 @@ __weak_alias(svc_fd_create,_svc_fd_creat __weak_alias(svc_vc_create,_svc_vc_create) #endif -#ifdef _REENTRANT -extern rwlock_t svc_fd_lock; -#endif - static SVCXPRT *makefd_xprt(int, u_int, u_int); static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *); static enum xprt_stat rendezvous_stat(SVCXPRT *); @@ -703,9 +699,6 @@ svc_vc_ops(SVCXPRT *xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif /* VARIABLES PROTECTED BY ops_lock: ops, ops2 */ @@ -729,9 +722,7 @@ svc_vc_rendezvous_ops(SVCXPRT *xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; -#ifdef _REENTRANT - extern mutex_t ops_lock; -#endif + mutex_lock(&ops_lock); if (ops.xp_recv == NULL) { ops.xp_recv = rendezvous_request; Index: src/lib/libc/rpc/xdr_rec.c diff -u src/lib/libc/rpc/xdr_rec.c:1.39 src/lib/libc/rpc/xdr_rec.c:1.40 --- src/lib/libc/rpc/xdr_rec.c:1.39 Fri Jun 16 16:01:20 2023 +++ src/lib/libc/rpc/xdr_rec.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: xdr_rec.c,v 1.39 2023/06/16 20:01:20 andvar Exp $ */ +/* $NetBSD: xdr_rec.c,v 1.40 2024/01/23 17:24:38 christos Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)xdr_rec.c 2.2 88/08/01 4.0 RPCSRC"; #else -__RCSID("$NetBSD: xdr_rec.c,v 1.39 2023/06/16 20:01:20 andvar Exp $"); +__RCSID("$NetBSD: xdr_rec.c,v 1.40 2024/01/23 17:24:38 christos Exp $"); #endif #endif @@ -59,6 +59,7 @@ __RCSID("$NetBSD: xdr_rec.c,v 1.39 2023/ */ #include "namespace.h" +#include "reentrant.h" #include <sys/types.h> Index: src/lib/libc/sys/__sigaction_siginfo.c diff -u src/lib/libc/sys/__sigaction_siginfo.c:1.1 src/lib/libc/sys/__sigaction_siginfo.c:1.2 --- src/lib/libc/sys/__sigaction_siginfo.c:1.1 Mon Nov 1 01:53:45 2021 +++ src/lib/libc/sys/__sigaction_siginfo.c Tue Jan 23 12:24:38 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigaction_siginfo.c,v 1.1 2021/11/01 05:53:45 thorpej Exp $ */ +/* $NetBSD: __sigaction_siginfo.c,v 1.2 2024/01/23 17:24:38 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: __sigaction_siginfo.c,v 1.1 2021/11/01 05:53:45 thorpej Exp $"); +__RCSID("$NetBSD: __sigaction_siginfo.c,v 1.2 2024/01/23 17:24:38 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -44,6 +44,7 @@ __RCSID("$NetBSD: __sigaction_siginfo.c, #define C(a,b) __CONCAT(a,b) #define __SIGTRAMP_SIGINFO \ C(__sigtramp_siginfo_,__SIGTRAMP_SIGINFO_VERSION) +extern const char __SIGTRAMP_SIGINFO[]; /* * This serves no purpose except as a marker that this function should @@ -55,7 +56,6 @@ int __sigaction_siginfo(int sig, const struct sigaction *act, struct sigaction *oact) { - extern const char __SIGTRAMP_SIGINFO[]; return __sigaction_sigtramp(sig, act, oact, __SIGTRAMP_SIGINFO, __SIGTRAMP_SIGINFO_VERSION);