From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/inet/rpc/auth_none.c | 13 ++-- libc/inet/rpc/auth_unix.c | 50 +++++++------ libc/inet/rpc/authunix_prot.c | 18 ++--- libc/inet/rpc/bindresvport.c | 17 +++-- libc/inet/rpc/clnt_generic.c | 30 ++++---- libc/inet/rpc/clnt_perror.c | 101 ++++++++++++++------------ libc/inet/rpc/clnt_raw.c | 19 ++--- libc/inet/rpc/clnt_simple.c | 18 +++-- libc/inet/rpc/clnt_tcp.c | 64 +++++++++-------- libc/inet/rpc/clnt_udp.c | 79 ++++++++++---------- libc/inet/rpc/clnt_unix.c | 71 +++++++++--------- libc/inet/rpc/create_xid.c | 8 +-- libc/inet/rpc/get_myaddress.c | 28 +++++--- libc/inet/rpc/getrpcent.c | 96 ++++++++++++++----------- libc/inet/rpc/getrpcport.c | 9 +-- libc/inet/rpc/pmap_clnt.c | 53 ++++++++------ libc/inet/rpc/pmap_getmaps.c | 6 +- libc/inet/rpc/pmap_getport.c | 15 ++-- libc/inet/rpc/pmap_prot.c | 3 +- libc/inet/rpc/pmap_prot2.c | 5 +- libc/inet/rpc/pmap_rmt.c | 74 ++++++++++--------- libc/inet/rpc/rcmd.c | 159 +++++++++++++++++++++++------------------ libc/inet/rpc/rexec.c | 95 +++++++++++++----------- libc/inet/rpc/rpc_callmsg.c | 28 ++++---- libc/inet/rpc/rpc_dtablesize.c | 11 +-- libc/inet/rpc/rpc_private.h | 5 +- libc/inet/rpc/rpc_prot.c | 52 ++++++++------ libc/inet/rpc/rpc_thread.c | 48 +++++++------ libc/inet/rpc/rtime.c | 19 ++--- libc/inet/rpc/ruserpass.c | 123 +++++++++++++++++-------------- libc/inet/rpc/svc.c | 131 ++++++++++++++++++--------------- libc/inet/rpc/svc_auth.c | 7 +- libc/inet/rpc/svc_auth_unix.c | 12 ++-- libc/inet/rpc/svc_raw.c | 8 +-- libc/inet/rpc/svc_run.c | 16 ++--- libc/inet/rpc/svc_simple.c | 34 +++++---- libc/inet/rpc/svc_tcp.c | 59 ++++++++------- libc/inet/rpc/svc_udp.c | 78 +++++++++++--------- libc/inet/rpc/svc_unix.c | 72 ++++++++++--------- libc/inet/rpc/xdr.c | 137 +++++++++++++++++++---------------- libc/inet/rpc/xdr_array.c | 19 ++--- libc/inet/rpc/xdr_mem.c | 13 ++-- libc/inet/rpc/xdr_rec.c | 43 ++++++----- libc/inet/rpc/xdr_reference.c | 21 +++--- libc/inet/rpc/xdr_stdio.c | 12 ++-- 45 files changed, 1092 insertions(+), 887 deletions(-) (limited to 'libc/inet/rpc') diff --git a/libc/inet/rpc/auth_none.c b/libc/inet/rpc/auth_none.c index cb30c40a7..06f65904a 100644 --- a/libc/inet/rpc/auth_none.c +++ b/libc/inet/rpc/auth_none.c @@ -35,13 +35,13 @@ * credentials and verifiers to remote systems. */ -#define xdrmem_create __xdrmem_create -#define xdr_opaque_auth __xdr_opaque_auth - #define __FORCE_GLIBC #include #include "rpc_private.h" +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(xdr_opaque_auth) + #define MAX_MARSHEL_SIZE 20 /* @@ -72,8 +72,8 @@ struct authnone_private_s { static struct authnone_private_s *authnone_private; #endif -AUTH attribute_hidden * -__authnone_create (void) +AUTH * +authnone_create (void) { struct authnone_private_s *ap; XDR xdr_stream; @@ -101,7 +101,8 @@ __authnone_create (void) } return (&ap->no_client); } -strong_alias(__authnone_create,authnone_create) +libc_hidden_proto(authnone_create) +libc_hidden_def(authnone_create) /*ARGSUSED */ static bool_t diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index bb14df068..dffdc6fad 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -38,17 +38,6 @@ * for the credentials. */ -#define sysconf __sysconf -#define getegid __getegid -#define geteuid __geteuid -#define getgroups __getgroups -#define gethostname __gethostname -#define xdrmem_create __xdrmem_create -#define xdr_authunix_parms __xdr_authunix_parms -#define xdr_opaque_auth __xdr_opaque_auth -#define gettimeofday __gettimeofday -#define fputs __fputs - #define __FORCE_GLIBC #include @@ -67,6 +56,23 @@ # include #endif +libc_hidden_proto(memcpy) +libc_hidden_proto(sysconf) +libc_hidden_proto(getegid) +libc_hidden_proto(geteuid) +libc_hidden_proto(getgroups) +libc_hidden_proto(gethostname) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(xdr_authunix_parms) +libc_hidden_proto(xdr_opaque_auth) +libc_hidden_proto(gettimeofday) +libc_hidden_proto(fputs) +libc_hidden_proto(perror) +libc_hidden_proto(abort) +#ifdef USE_IN_LIBIO +libc_hidden_proto(fwprintf) +#endif + /* * Unix authenticator operations vector */ @@ -103,8 +109,8 @@ static bool_t marshal_new_auth (AUTH *) internal_function; * Create a unix style authenticator. * Returns an auth handle with the given stuff in it. */ -AUTH attribute_hidden * -__authunix_create (char *machname, uid_t uid, gid_t gid, int len, +AUTH * +authunix_create (char *machname, uid_t uid, gid_t gid, int len, gid_t *aup_gids) { struct authunix_parms aup; @@ -124,7 +130,7 @@ __authunix_create (char *machname, uid_t uid, gid_t gid, int len, no_memory: #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", + (void) fwprintf (stderr, L"%s", _("authunix_create: out of memory\n")); else #endif @@ -160,7 +166,7 @@ no_memory: au->au_origcred.oa_base = mem_alloc ((u_int) len); if (au->au_origcred.oa_base == NULL) goto no_memory; - __memcpy(au->au_origcred.oa_base, mymem, (u_int) len); + memcpy(au->au_origcred.oa_base, mymem, (u_int) len); /* * set auth handle to reflect new cred. @@ -169,14 +175,15 @@ no_memory: marshal_new_auth (auth); return auth; } -strong_alias(__authunix_create,authunix_create) +libc_hidden_proto(authunix_create) +libc_hidden_def(authunix_create) /* * Returns an auth handle with parameters determined by doing lots of * syscalls. */ -AUTH attribute_hidden * -__authunix_create_default (void) +AUTH * +authunix_create_default (void) { int len; char machname[MAX_MACHINE_NAME + 1]; @@ -203,12 +210,13 @@ __authunix_create_default (void) /* This braindamaged Sun code forces us here to truncate the list of groups to NGRPS members since the code in authuxprot.c transforms a fixed array. Grrr. */ - ret_auth = __authunix_create (machname, uid, gid, MIN (NGRPS, len), gids); + ret_auth = authunix_create (machname, uid, gid, MIN (NGRPS, len), gids); if (gids) free (gids); return ret_auth; } -strong_alias(__authunix_create_default,authunix_create_default) +libc_hidden_proto(authunix_create_default) +libc_hidden_def(authunix_create_default) /* * authunix operations @@ -338,7 +346,7 @@ marshal_new_auth (AUTH *auth) xdrmem_create (xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); if ((!xdr_opaque_auth (xdrs, &(auth->ah_cred))) || (!xdr_opaque_auth (xdrs, &(auth->ah_verf)))) - __perror (_("auth_none.c - Fatal marshalling problem")); + perror (_("auth_none.c - Fatal marshalling problem")); else au->au_mpos = XDR_GETPOS (xdrs); diff --git a/libc/inet/rpc/authunix_prot.c b/libc/inet/rpc/authunix_prot.c index 32da3256d..1587b5688 100644 --- a/libc/inet/rpc/authunix_prot.c +++ b/libc/inet/rpc/authunix_prot.c @@ -34,22 +34,23 @@ * XDR for UNIX style authentication parameters for RPC */ -#define xdr_string __xdr_string -#define xdr_u_int __xdr_u_int -#define xdr_array __xdr_array -#define xdr_u_long __xdr_u_long - #include #include #include #include +libc_hidden_proto(xdr_string) +libc_hidden_def(xdr_string) +libc_hidden_proto(xdr_u_int) +libc_hidden_proto(xdr_array) +libc_hidden_proto(xdr_u_long) + /* * XDR for unix authentication parameters. * Unfortunately, none of these can be declared const. */ -bool_t attribute_hidden -__xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p) +bool_t +xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p) { if (xdr_u_long (xdrs, &(p->aup_time)) && xdr_string (xdrs, &(p->aup_machname), MAX_MACHINE_NAME) @@ -68,4 +69,5 @@ __xdr_authunix_parms (XDR * xdrs, struct authunix_parms *p) } return FALSE; } -strong_alias(__xdr_authunix_parms,xdr_authunix_parms) +libc_hidden_proto(xdr_authunix_parms) +libc_hidden_def(xdr_authunix_parms) diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index 530df52b3..68b44d26a 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/libc/inet/rpc/bindresvport.c @@ -30,8 +30,6 @@ * Copyright (c) 1987 by Sun Microsystems, Inc. */ -#define bind __bind - #define __FORCE_GLIBC #include @@ -42,11 +40,15 @@ #include #include +libc_hidden_proto(memset) +libc_hidden_proto(bind) +libc_hidden_proto(getpid) + /* * Bind a socket to a privileged IP port */ -int attribute_hidden -__bindresvport (int sd, struct sockaddr_in *sin) +int +bindresvport (int sd, struct sockaddr_in *sin) { int res; static short port; @@ -60,7 +62,7 @@ __bindresvport (int sd, struct sockaddr_in *sin) if (sin == (struct sockaddr_in *) 0) { sin = &myaddr; - __memset (sin, 0, sizeof (*sin)); + memset (sin, 0, sizeof (*sin)); sin->sin_family = AF_INET; } else if (sin->sin_family != AF_INET) @@ -71,7 +73,7 @@ __bindresvport (int sd, struct sockaddr_in *sin) if (port == 0) { - port = (__getpid () % NPORTS) + STARTPORT; + port = (getpid () % NPORTS) + STARTPORT; } res = -1; __set_errno (EADDRINUSE); @@ -88,4 +90,5 @@ __bindresvport (int sd, struct sockaddr_in *sin) return res; } -strong_alias(__bindresvport,bindresvport) +libc_hidden_proto(bindresvport) +libc_hidden_def(bindresvport) diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c index cfd357f63..899a9dd0e 100644 --- a/libc/inet/rpc/clnt_generic.c +++ b/libc/inet/rpc/clnt_generic.c @@ -30,12 +30,6 @@ * Copyright (C) 1987, Sun Microsystems, Inc. */ -#define clnttcp_create __clnttcp_create -#define clntudp_create __clntudp_create -#define clntunix_create __clntunix_create -#define getprotobyname_r __getprotobyname_r -#define gethostbyname_r __gethostbyname_r - #define __FORCE_GLIBC #include @@ -46,10 +40,16 @@ #include #include -#undef get_rpc_createerr -extern struct rpc_createerr *__rpc_thread_createerr_internal (void) - __attribute__ ((__const__)) attribute_hidden; -#define get_rpc_createerr() (*__rpc_thread_createerr_internal ()) +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +libc_hidden_proto(strcmp) +libc_hidden_proto(strcpy) +libc_hidden_proto(clnttcp_create) +libc_hidden_proto(clntudp_create) +libc_hidden_proto(clntunix_create) +libc_hidden_proto(getprotobyname_r) +libc_hidden_proto(gethostbyname_r) +libc_hidden_proto(__rpc_thread_createerr) /* * Generic client creation: takes (hostname, program-number, protocol) and @@ -73,11 +73,11 @@ clnt_create (const char *hostname, u_long prog, u_long vers, CLIENT *client; int herr; - if (__strcmp (proto, "unix") == 0) + if (strcmp (proto, "unix") == 0) { - __memset ((char *)&sun, 0, sizeof (sun)); + memset ((char *)&sun, 0, sizeof (sun)); sun.sun_family = AF_UNIX; - __strcpy (sun.sun_path, hostname); + strcpy (sun.sun_path, hostname); sock = RPC_ANYSOCK; client = clntunix_create (&sun, prog, vers, &sock, 0, 0); if (client == NULL) @@ -122,8 +122,8 @@ clnt_create (const char *hostname, u_long prog, u_long vers, } sin.sin_family = h->h_addrtype; sin.sin_port = 0; - __memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); - __memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); + memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); + memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); prtbuflen = 1024; prttmpbuf = alloca (prtbuflen); diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c index eba539c95..c01390598 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -38,8 +38,6 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro"; * */ -#define fputs __fputs - #define __FORCE_GLIBC #include @@ -53,6 +51,15 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro"; # define fputs(s, f) _IO_fputs (s, f) #endif +libc_hidden_proto(strcpy) +libc_hidden_proto(strlen) +libc_hidden_proto(sprintf) +libc_hidden_proto(__glibc_strerror_r) +libc_hidden_proto(fputs) +#ifdef USE_IN_LIBIO +libc_hidden_proto(fwprintf) +#endif + static char *auth_errmsg (enum auth_stat stat) internal_function; #ifdef __UCLIBC_HAS_THREADS__ @@ -179,8 +186,8 @@ static const struct rpc_errtab rpc_errlist[] = /* * This interface for use by clntrpc */ -char attribute_hidden * -__clnt_sperrno (enum clnt_stat stat) +char * +clnt_sperrno (enum clnt_stat stat) { size_t i; @@ -193,24 +200,25 @@ __clnt_sperrno (enum clnt_stat stat) } return _("RPC: (unknown error code)"); } -strong_alias(__clnt_sperrno,clnt_sperrno) +libc_hidden_proto(clnt_sperrno) +libc_hidden_def(clnt_sperrno) void clnt_perrno (enum clnt_stat num) { #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", __clnt_sperrno (num)); + (void) fwprintf (stderr, L"%s", clnt_sperrno (num)); else #endif - (void) fputs (__clnt_sperrno (num), stderr); + (void) fputs (clnt_sperrno (num), stderr); } /* * Print reply error info */ -char attribute_hidden * -__clnt_sperror (CLIENT * rpch, const char *msg) +char * +clnt_sperror (CLIENT * rpch, const char *msg) { char chrbuf[1024]; struct rpc_err e; @@ -223,11 +231,11 @@ __clnt_sperror (CLIENT * rpch, const char *msg) return NULL; CLNT_GETERR (rpch, &e); - len = __sprintf (str, "%s: ", msg); + len = sprintf (str, "%s: ", msg); str += len; - (void) __strcpy(str, __clnt_sperrno(e.re_status)); - str += __strlen(str); + (void) strcpy(str, clnt_sperrno(e.re_status)); + str += strlen(str); switch (e.re_status) { @@ -248,43 +256,43 @@ __clnt_sperror (CLIENT * rpch, const char *msg) case RPC_CANTSEND: case RPC_CANTRECV: - __glibc_strerror_r_internal (e.re_errno, chrbuf, sizeof chrbuf); - len = __sprintf (str, "; errno = %s", chrbuf); + __glibc_strerror_r (e.re_errno, chrbuf, sizeof chrbuf); + len = sprintf (str, "; errno = %s", chrbuf); str += len; break; case RPC_VERSMISMATCH: - len= __sprintf (str, _("; low version = %lu, high version = %lu"), + len= sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; case RPC_AUTHERROR: err = auth_errmsg (e.re_why); - (void) __strcpy(str, _("; why = ")); - str += __strlen(str); + (void) strcpy(str, _("; why = ")); + str += strlen(str); if (err != NULL) { - (void) __strcpy(str, err); - str += __strlen(str); + (void) strcpy(str, err); + str += strlen(str); } else { - len = __sprintf (str, _("(unknown authentication error - %d)"), + len = sprintf (str, _("(unknown authentication error - %d)"), (int) e.re_why); str += len; } break; case RPC_PROGVERSMISMATCH: - len = __sprintf (str, _("; low version = %lu, high version = %lu"), + len = sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; default: /* unknown */ - len = __sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); + len = sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); str += len; break; } @@ -292,22 +300,24 @@ __clnt_sperror (CLIENT * rpch, const char *msg) *++str = '\0'; return (strstart); } -strong_alias(__clnt_sperror,clnt_sperror) +libc_hidden_proto(clnt_sperror) +libc_hidden_def(clnt_sperror) -void attribute_hidden -__clnt_perror (CLIENT * rpch, const char *msg) +void +clnt_perror (CLIENT * rpch, const char *msg) { #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", __clnt_sperror (rpch, msg)); + (void) fwprintf (stderr, L"%s", clnt_sperror (rpch, msg)); else #endif - (void) fputs (__clnt_sperror (rpch, msg), stderr); + (void) fputs (clnt_sperror (rpch, msg), stderr); } -strong_alias(__clnt_perror,clnt_perror) +libc_hidden_proto(clnt_perror) +libc_hidden_def(clnt_perror) -char attribute_hidden * -__clnt_spcreateerror (const char *msg) +char * +clnt_spcreateerror (const char *msg) { char chrbuf[1024]; char *str = _buf (); @@ -318,29 +328,29 @@ __clnt_spcreateerror (const char *msg) if (str == NULL) return NULL; ce = &get_rpc_createerr (); - len = __sprintf (str, "%s: ", msg); + len = sprintf (str, "%s: ", msg); cp = str + len; - (void) __strcpy(cp, __clnt_sperrno (ce->cf_stat)); - cp += __strlen(cp); + (void) strcpy(cp, clnt_sperrno (ce->cf_stat)); + cp += strlen(cp); switch (ce->cf_stat) { case RPC_PMAPFAILURE: - (void) __strcpy(cp, " - "); - cp += __strlen(cp); + (void) strcpy(cp, " - "); + cp += strlen(cp); - (void) __strcpy(cp, __clnt_sperrno (ce->cf_error.re_status)); - cp += __strlen(cp); + (void) strcpy(cp, clnt_sperrno (ce->cf_error.re_status)); + cp += strlen(cp); break; case RPC_SYSTEMERROR: - (void) __strcpy(cp, " - "); - cp += __strlen(cp); + (void) strcpy(cp, " - "); + cp += strlen(cp); - __glibc_strerror_r_internal (ce->cf_error.re_errno, chrbuf, sizeof chrbuf); - (void) __strcpy(cp, chrbuf); - cp += __strlen(cp); + __glibc_strerror_r (ce->cf_error.re_errno, chrbuf, sizeof chrbuf); + (void) strcpy(cp, chrbuf); + cp += strlen(cp); break; default: break; @@ -349,17 +359,18 @@ __clnt_spcreateerror (const char *msg) *++cp = '\0'; return str; } -strong_alias(__clnt_spcreateerror,clnt_spcreateerror) +libc_hidden_proto(clnt_spcreateerror) +libc_hidden_def(clnt_spcreateerror) void clnt_pcreateerror (const char *msg) { #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", __clnt_spcreateerror (msg)); + (void) fwprintf (stderr, L"%s", clnt_spcreateerror (msg)); else #endif - (void) fputs (__clnt_spcreateerror (msg), stderr); + (void) fputs (clnt_spcreateerror (msg), stderr); } struct auth_errtab diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c index 37b99ecb1..b44bd38b8 100644 --- a/libc/inet/rpc/clnt_raw.c +++ b/libc/inet/rpc/clnt_raw.c @@ -42,20 +42,21 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro"; * any interference from the kernel. */ -#define authnone_create __authnone_create -#define xdrmem_create __xdrmem_create -#define xdr_callhdr __xdr_callhdr -#define xdr_replymsg __xdr_replymsg -#define xdr_opaque_auth __xdr_opaque_auth -#define svc_getreq __svc_getreq -#define _seterr_reply __seterr_reply - #define __FORCE_GLIBC #include #include "rpc_private.h" #include #include +libc_hidden_proto(perror) +libc_hidden_proto(authnone_create) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(xdr_callhdr) +libc_hidden_proto(xdr_replymsg) +libc_hidden_proto(xdr_opaque_auth) +libc_hidden_proto(svc_getreq) +libc_hidden_proto(_seterr_reply) + #define MCALL_MSG_SIZE 24 /* @@ -121,7 +122,7 @@ clntraw_create (u_long prog, u_long vers) xdrmem_create (xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE); if (!xdr_callhdr (xdrs, &call_msg)) { - __perror (_ ("clnt_raw.c - Fatal header serialization error.")); + perror (_ ("clnt_raw.c - Fatal header serialization error.")); } clp->mcnt = XDR_GETPOS (xdrs); XDR_DESTROY (xdrs); diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c index 7c17dc1f1..f9f18f3d4 100644 --- a/libc/inet/rpc/clnt_simple.c +++ b/libc/inet/rpc/clnt_simple.c @@ -38,9 +38,6 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define clntudp_create __clntudp_create -#define gethostbyname_r __gethostbyname_r - #define __FORCE_GLIBC #include @@ -53,6 +50,13 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro"; #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(strcmp) +libc_hidden_proto(strncpy) +libc_hidden_proto(close) +libc_hidden_proto(clntudp_create) +libc_hidden_proto(gethostbyname_r) + struct callrpc_private_s { CLIENT *client; @@ -90,7 +94,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->socket = RPC_ANYSOCK; } if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum - && __strcmp (crp->oldhost, host) == 0) + && strcmp (crp->oldhost, host) == 0) { /* reuse old client */ } @@ -103,7 +107,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 0; if (crp->socket != RPC_ANYSOCK) { - (void) __close (crp->socket); + (void) close (crp->socket); crp->socket = RPC_ANYSOCK; } if (crp->client) @@ -128,7 +132,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, timeout.tv_usec = 0; timeout.tv_sec = 5; - __memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); + memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); server_addr.sin_family = AF_INET; server_addr.sin_port = 0; if ((crp->client = clntudp_create (&server_addr, (u_long) prognum, @@ -137,7 +141,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; - (void) __strncpy (crp->oldhost, host, 255); + (void) strncpy (crp->oldhost, host, 255); crp->oldhost[255] = '\0'; } tottimeout.tv_sec = 25; diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index 8dcb4682a..8837062c9 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -50,21 +50,6 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; * Now go hang yourself. */ -#define authnone_create __authnone_create -#define xdrrec_create __xdrrec_create -#define xdrrec_endofrecord __xdrrec_endofrecord -#define xdrrec_skiprecord __xdrrec_skiprecord -#define xdr_callhdr __xdr_callhdr -#define xdr_replymsg __xdr_replymsg -#define xdr_opaque_auth __xdr_opaque_auth -#define xdrmem_create __xdrmem_create -#define pmap_getport __pmap_getport -#define _seterr_reply __seterr_reply -#define connect __connect -#define bindresvport __bindresvport -#define poll __poll -#define fputs __fputs - #define __FORCE_GLIBC #include @@ -80,12 +65,30 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; # include #endif -extern u_long _create_xid (void) attribute_hidden; +libc_hidden_proto(socket) +libc_hidden_proto(read) +libc_hidden_proto(write) +libc_hidden_proto(close) +libc_hidden_proto(authnone_create) +libc_hidden_proto(xdrrec_create) +libc_hidden_proto(xdrrec_endofrecord) +libc_hidden_proto(xdrrec_skiprecord) +libc_hidden_proto(xdr_callhdr) +libc_hidden_proto(xdr_replymsg) +libc_hidden_proto(xdr_opaque_auth) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(pmap_getport) +libc_hidden_proto(_seterr_reply) +libc_hidden_proto(connect) +libc_hidden_proto(bindresvport) +libc_hidden_proto(poll) +libc_hidden_proto(fputs) +#ifdef USE_IN_LIBIO +libc_hidden_proto(fwprintf) +#endif +libc_hidden_proto(__rpc_thread_createerr) -#undef get_rpc_createerr -extern struct rpc_createerr *__rpc_thread_createerr_internal (void) - __attribute__ ((__const__)) attribute_hidden; -#define get_rpc_createerr() (*__rpc_thread_createerr_internal ()) +extern u_long _create_xid (void) attribute_hidden; #define MCALL_MSG_SIZE 24 @@ -137,8 +140,8 @@ static struct clnt_ops tcp_ops = * NB: The rpch->cl_auth is set null authentication. Caller may wish to set this * something more useful. */ -CLIENT attribute_hidden * -__clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, +CLIENT * +clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, int *sockp, u_int sendsz, u_int recvsz) { CLIENT *h; @@ -152,7 +155,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, struct rpc_createerr *ce = &get_rpc_createerr (); #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", + (void) fwprintf (stderr, L"%s", _("clnttcp_create: out of memory\n")); else #endif @@ -182,7 +185,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, */ if (*sockp < 0) { - *sockp = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); + *sockp = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); (void) bindresvport (*sockp, (struct sockaddr_in *) 0); if ((*sockp < 0) || (connect (*sockp, (struct sockaddr *) raddr, @@ -192,7 +195,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp >= 0) - (void) __close (*sockp); + (void) close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -228,7 +231,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, { if (ct->ct_closeit) { - (void) __close (*sockp); + (void) close (*sockp); } goto fooy; } @@ -254,7 +257,8 @@ fooy: mem_free ((caddr_t) h, sizeof (CLIENT)); return ((CLIENT *) NULL); } -strong_alias(__clnttcp_create,clnttcp_create) +libc_hidden_proto(clnttcp_create) +libc_hidden_def(clnttcp_create) static enum clnt_stat clnttcp_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout) @@ -482,7 +486,7 @@ clnttcp_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) __close (ct->ct_sock); + (void) close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -524,7 +528,7 @@ readtcp (char *ctptr, char *buf, int len) } break; } - switch (len = __read (ct->ct_sock, buf, len)) + switch (len = read (ct->ct_sock, buf, len)) { case 0: @@ -550,7 +554,7 @@ writetcp (char *ctptr, char *buf, int len) for (cnt = len; cnt > 0; cnt -= i, buf += i) { - if ((i = __write (ct->ct_sock, buf, cnt)) == -1) + if ((i = write (ct->ct_sock, buf, cnt)) == -1) { ct->ct_error.re_errno = errno; ct->ct_error.re_status = RPC_CANTSEND; diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index bd93fd022..8f3cad926 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -37,24 +37,6 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -/* CMSG_NXTHDR is using it */ -#define __cmsg_nxthdr __cmsg_nxthdr_internal - -#define authnone_create __authnone_create -#define xdrmem_create __xdrmem_create -#define xdr_callhdr __xdr_callhdr -#define xdr_replymsg __xdr_replymsg -#define xdr_opaque_auth __xdr_opaque_auth -#define pmap_getport __pmap_getport -#define _seterr_reply __seterr_reply -#define setsockopt __setsockopt -#define bindresvport __bindresvport -#define recvfrom __recvfrom -#define sendto __sendto -#define recvmsg __recvmsg -#define poll __poll -#define fputs __fputs - #define __FORCE_GLIBC #include @@ -72,6 +54,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #include #ifdef USE_IN_LIBIO # include +libc_hidden_proto(fwprintf) #endif #ifdef IP_RECVERR @@ -79,12 +62,30 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #include #endif -extern u_long _create_xid (void) attribute_hidden; +libc_hidden_proto(memcmp) +libc_hidden_proto(ioctl) +libc_hidden_proto(socket) +libc_hidden_proto(close) +/* CMSG_NXTHDR is using it */ +libc_hidden_proto(__cmsg_nxthdr) + +libc_hidden_proto(authnone_create) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(xdr_callhdr) +libc_hidden_proto(xdr_replymsg) +libc_hidden_proto(xdr_opaque_auth) +libc_hidden_proto(pmap_getport) +libc_hidden_proto(_seterr_reply) +libc_hidden_proto(setsockopt) +libc_hidden_proto(bindresvport) +libc_hidden_proto(recvfrom) +libc_hidden_proto(sendto) +libc_hidden_proto(recvmsg) +libc_hidden_proto(poll) +libc_hidden_proto(fputs) +libc_hidden_proto(__rpc_thread_createerr) -#undef get_rpc_createerr -extern struct rpc_createerr *__rpc_thread_createerr_internal (void) - __attribute__ ((__const__)) attribute_hidden; -#define get_rpc_createerr() (*__rpc_thread_createerr_internal ()) +extern u_long _create_xid (void) attribute_hidden; /* * UDP bases client side rpc operations @@ -143,8 +144,8 @@ struct cu_data * sendsz and recvsz are the maximum allowable packet sizes that can be * sent and received. */ -CLIENT attribute_hidden * -__clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, +CLIENT * +clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp, u_int sendsz, u_int recvsz) { @@ -161,7 +162,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, struct rpc_createerr *ce = &get_rpc_createerr (); #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", + (void) fwprintf (stderr, L"%s", _("clntudp_create: out of memory\n")); else #endif @@ -207,7 +208,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, { int dontblock = 1; - *sockp = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); + *sockp = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (*sockp < 0) { struct rpc_createerr *ce = &get_rpc_createerr (); @@ -218,7 +219,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, /* attempt to bind to prov port */ (void) bindresvport (*sockp, (struct sockaddr_in *) 0); /* the sockets rpc controls are non-blocking */ - (void) __ioctl (*sockp, FIONBIO, (char *) &dontblock); + (void) ioctl (*sockp, FIONBIO, (char *) &dontblock); #ifdef IP_RECVERR { int on = 1; @@ -241,16 +242,18 @@ fooy: mem_free ((caddr_t) cl, sizeof (CLIENT)); return (CLIENT *) NULL; } -strong_alias(__clntudp_bufcreate,clntudp_bufcreate) +libc_hidden_proto(clntudp_bufcreate) +libc_hidden_def(clntudp_bufcreate) -CLIENT attribute_hidden * -__clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp) +CLIENT * +clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version, struct timeval wait, int *sockp) { - return __clntudp_bufcreate (raddr, program, version, wait, sockp, + return clntudp_bufcreate (raddr, program, version, wait, sockp, UDPMSGSIZE, UDPMSGSIZE); } -strong_alias(__clntudp_create,clntudp_create) +libc_hidden_proto(clntudp_create) +libc_hidden_def(clntudp_create) static int is_network_up (int sock) @@ -262,13 +265,13 @@ is_network_up (int sock) ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (__ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0) + if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0) { ifr = ifc.ifc_req; for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++) { ifreq = *ifr; - if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) break; if ((ifreq.ifr_flags & IFF_UP) @@ -419,13 +422,13 @@ send_again: msg.msg_controllen = 256; ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE); if (ret >= 0 - && __memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 + && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 && (msg.msg_flags & MSG_ERRQUEUE) && ((msg.msg_namelen == 0 && ret >= 12) || (msg.msg_namelen == sizeof (err_addr) && err_addr.sin_family == AF_INET - && __memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, + && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, sizeof (err_addr.sin_addr)) == 0 && err_addr.sin_port == cu->cu_raddr.sin_port))) for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; @@ -620,7 +623,7 @@ clntudp_destroy (CLIENT *cl) if (cu->cu_closeit) { - (void) __close (cu->cu_sock); + (void) close (cu->cu_sock); } XDR_DESTROY (&(cu->cu_outxdrs)); mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz)); diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index e0483b4e2..29944af0f 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -46,24 +46,6 @@ * Now go hang yourself. */ -#define authnone_create __authnone_create -#define xdrrec_create __xdrrec_create -#define xdrrec_endofrecord __xdrrec_endofrecord -#define xdrrec_skiprecord __xdrrec_skiprecord -#define xdr_callhdr __xdr_callhdr -#define xdr_replymsg __xdr_replymsg -#define xdr_opaque_auth __xdr_opaque_auth -#define xdrmem_create __xdrmem_create -#define getegid __getegid -#define geteuid __geteuid -#define _seterr_reply __seterr_reply -#define setsockopt __setsockopt -#define connect __connect -#define recvmsg __recvmsg -#define sendmsg __sendmsg -#define poll __poll -#define fputs __fputs - #define __FORCE_GLIBC #include @@ -78,14 +60,34 @@ #include #ifdef USE_IN_LIBIO # include +libc_hidden_proto(fwprintf) #endif -extern u_long _create_xid (void) attribute_hidden; +libc_hidden_proto(strlen) +libc_hidden_proto(memcpy) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(getpid) +libc_hidden_proto(authnone_create) +libc_hidden_proto(xdrrec_create) +libc_hidden_proto(xdrrec_endofrecord) +libc_hidden_proto(xdrrec_skiprecord) +libc_hidden_proto(xdr_callhdr) +libc_hidden_proto(xdr_replymsg) +libc_hidden_proto(xdr_opaque_auth) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(getegid) +libc_hidden_proto(geteuid) +libc_hidden_proto(_seterr_reply) +libc_hidden_proto(setsockopt) +libc_hidden_proto(connect) +libc_hidden_proto(recvmsg) +libc_hidden_proto(sendmsg) +libc_hidden_proto(poll) +libc_hidden_proto(fputs) +libc_hidden_proto(__rpc_thread_createerr) -#undef get_rpc_createerr -extern struct rpc_createerr *__rpc_thread_createerr_internal (void) - __attribute__ ((__const__)) attribute_hidden; -#define get_rpc_createerr() (*__rpc_thread_createerr_internal ()) +extern u_long _create_xid (void) attribute_hidden; #define MCALL_MSG_SIZE 24 @@ -137,8 +139,8 @@ static struct clnt_ops unix_ops = * NB: The rpch->cl_auth is set null authentication. Caller may wish to set this * something more useful. */ -CLIENT attribute_hidden * -__clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, +CLIENT * +clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, int *sockp, u_int sendsz, u_int recvsz) { CLIENT *h; @@ -152,7 +154,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, struct rpc_createerr *ce = &get_rpc_createerr (); #ifdef USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", + (void) fwprintf (stderr, L"%s", _("clntunix_create: out of memory\n")); else #endif @@ -167,8 +169,8 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, */ if (*sockp < 0) { - *sockp = __socket (AF_UNIX, SOCK_STREAM, 0); - len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; + *sockp = socket (AF_UNIX, SOCK_STREAM, 0); + len = strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; if (*sockp < 0 || connect (*sockp, (struct sockaddr *) raddr, len) < 0) { @@ -176,7 +178,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp != -1) - __close (*sockp); + close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -210,7 +212,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg)) { if (ct->ct_closeit) - __close (*sockp); + close (*sockp); goto fooy; } ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs)); @@ -235,7 +237,8 @@ fooy: mem_free ((caddr_t) h, sizeof (CLIENT)); return (CLIENT *) NULL; } -strong_alias(__clntunix_create,clntunix_create) +libc_hidden_proto(clntunix_create) +libc_hidden_def(clntunix_create) static enum clnt_stat clntunix_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout) @@ -457,7 +460,7 @@ clntunix_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) __close (ct->ct_sock); + (void) close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -526,11 +529,11 @@ __msgwrite (int sock, void *data, size_t cnt) /* XXX I'm not sure, if gete?id() is always correct, or if we should use get?id(). But since keyserv needs geteuid(), we have no other chance. It would be much better, if the kernel could pass both to the server. */ - cred.pid = __getpid (); + cred.pid = getpid (); cred.uid = geteuid (); cred.gid = getegid (); - __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); + memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred); diff --git a/libc/inet/rpc/create_xid.c b/libc/inet/rpc/create_xid.c index 69b83ff59..3527eef17 100644 --- a/libc/inet/rpc/create_xid.c +++ b/libc/inet/rpc/create_xid.c @@ -17,10 +17,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define lrand48_r __lrand48_r -#define srand48_r __srand48_r -#define gettimeofday __gettimeofday - #define __FORCE_GLIBC #include @@ -29,6 +25,10 @@ #include #include +libc_hidden_proto(lrand48_r) +libc_hidden_proto(srand48_r) +libc_hidden_proto(gettimeofday) + /* The RPC code is not threadsafe, but new code should be threadsafe. */ #ifdef __UCLIBC_HAS_THREADS__ diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index 45fbe359f..a6ba07811 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -50,6 +50,12 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro"; #include #include +libc_hidden_proto(ioctl) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(perror) +libc_hidden_proto(exit) + /* * don't use gethostbyname, which would invoke yellow pages * @@ -65,17 +71,17 @@ get_myaddress (struct sockaddr_in *addr) struct ifreq ifreq, *ifr; int len, loopback = 0; - if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0) { - __perror ("get_myaddress: socket"); - __exit (1); + perror ("get_myaddress: socket"); + exit (1); } ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) + if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) { - __perror (_("get_myaddress: ioctl (get interface configuration)")); - __exit (1); + perror (_("get_myaddress: ioctl (get interface configuration)")); + exit (1); } again: @@ -83,10 +89,10 @@ get_myaddress (struct sockaddr_in *addr) for (len = ifc.ifc_len; len; len -= sizeof ifreq) { ifreq = *ifr; - if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) { - __perror ("get_myaddress: ioctl"); - __exit (1); + perror ("get_myaddress: ioctl"); + exit (1); } if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET) && (!(ifreq.ifr_flags & IFF_LOOPBACK) || @@ -94,7 +100,7 @@ get_myaddress (struct sockaddr_in *addr) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - __close (s); + close (s); return; } ifr++; @@ -104,5 +110,5 @@ get_myaddress (struct sockaddr_in *addr) loopback = 1; goto again; } - __close (s); + close (s); } diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c index 100469879..83dcc7e78 100644 --- a/libc/inet/rpc/getrpcent.c +++ b/libc/inet/rpc/getrpcent.c @@ -33,10 +33,6 @@ * Copyright (c) 1985 by Sun Microsystems, Inc. */ -#define atoi __atoi -#define rewind __rewind -#define fgets __fgets - #define __FORCE_GLIBC #include #include @@ -48,6 +44,17 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +libc_hidden_proto(strchr) +libc_hidden_proto(strcmp) +libc_hidden_proto(strlen) +libc_hidden_proto(fopen) +libc_hidden_proto(fclose) +libc_hidden_proto(atoi) +libc_hidden_proto(rewind) +libc_hidden_proto(fgets) + /* * Internet version. */ @@ -77,7 +84,7 @@ static struct rpcdata *_rpcdata(void) return d; } -void attribute_hidden __endrpcent(void) +void endrpcent(void) { register struct rpcdata *d = _rpcdata(); @@ -94,9 +101,10 @@ void attribute_hidden __endrpcent(void) d->rpcf = NULL; } } -strong_alias(__endrpcent,endrpcent) +libc_hidden_proto(endrpcent) +libc_hidden_def(endrpcent) -void attribute_hidden __setrpcent(int f) +void setrpcent(int f) { register struct rpcdata *d = _rpcdata(); @@ -111,7 +119,8 @@ void attribute_hidden __setrpcent(int f) d->current = NULL; d->stayopen |= f; } -strong_alias(__setrpcent,setrpcent) +libc_hidden_proto(setrpcent) +libc_hidden_def(setrpcent) static struct rpcent *interpret(struct rpcdata *); @@ -122,7 +131,7 @@ static struct rpcent *__get_next_rpcent(struct rpcdata *d) return interpret(d); } -struct rpcent attribute_hidden *__getrpcent(void) +struct rpcent *getrpcent(void) { register struct rpcdata *d = _rpcdata(); @@ -132,51 +141,54 @@ struct rpcent attribute_hidden *__getrpcent(void) return NULL; return __get_next_rpcent(d); } -strong_alias(__getrpcent,getrpcent) +libc_hidden_proto(getrpcent) +libc_hidden_def(getrpcent) -struct rpcent attribute_hidden *__getrpcbynumber(register int number) +struct rpcent *getrpcbynumber(register int number) { register struct rpcdata *d = _rpcdata(); register struct rpcent *rpc; if (d == NULL) return NULL; - __setrpcent(0); - while ((rpc = __getrpcent())) { + setrpcent(0); + while ((rpc = getrpcent())) { if (rpc->r_number == number) break; } - __endrpcent(); + endrpcent(); return rpc; } -strong_alias(__getrpcbynumber,getrpcbynumber) +libc_hidden_proto(getrpcbynumber) +libc_hidden_def(getrpcbynumber) -struct rpcent attribute_hidden *__getrpcbyname(const char *name) +struct rpcent *getrpcbyname(const char *name) { struct rpcent *rpc; char **rp; - __setrpcent(0); - while ((rpc = __getrpcent())) { - if (__strcmp(rpc->r_name, name) == 0) + setrpcent(0); + while ((rpc = getrpcent())) { + if (strcmp(rpc->r_name, name) == 0) return rpc; for (rp = rpc->r_aliases; *rp != NULL; rp++) { - if (__strcmp(*rp, name) == 0) + if (strcmp(*rp, name) == 0) return rpc; } } - __endrpcent(); + endrpcent(); return NULL; } -strong_alias(__getrpcbyname,getrpcbyname) +libc_hidden_proto(getrpcbyname) +libc_hidden_def(getrpcbyname) #ifdef __linux__ static char *firstwhite(char *s) { char *s1, *s2; - s1 = __strchr(s, ' '); - s2 = __strchr(s, '\t'); + s1 = strchr(s, ' '); + s2 = strchr(s, '\t'); if (s1) { if (s2) return (s1 < s2) ? s1 : s2; @@ -193,12 +205,12 @@ static struct rpcent *interpret(register struct rpcdata *d) register char *cp, **q; p = d->line; - d->line[__strlen(p)-1] = '\n'; + d->line[strlen(p)-1] = '\n'; if (*p == '#') return __get_next_rpcent(d); - cp = __strchr(p, '#'); + cp = strchr(p, '#'); if (cp == NULL) { - cp = __strchr(p, '\n'); + cp = strchr(p, '\n'); if (cp == NULL) return __get_next_rpcent(d); } @@ -209,9 +221,9 @@ static struct rpcent *interpret(register struct rpcdata *d) else return __get_next_rpcent(d); #else - cp = __strchr(p, ' '); + cp = strchr(p, ' '); if (cp == NULL) { - cp = __strchr(p, '\t'); + cp = strchr(p, '\t'); if (cp == NULL) return __get_next_rpcent(d); } @@ -227,11 +239,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = __strchr(p, ' '); + cp = strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = __strchr(p, '\t'); + cp = strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -247,11 +259,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = __strchr(p, ' '); + cp = strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = __strchr(p, '\t'); + cp = strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -281,8 +293,8 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff return ENOENT; /* copy the struct from the shared mem */ - __memset(result_buf, 0x00, sizeof(*result_buf)); - __memset(buffer, 0x00, buflen); + memset(result_buf, 0x00, sizeof(*result_buf)); + memset(buffer, 0x00, buflen); result_buf->r_number = r->r_number; @@ -299,21 +311,21 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff buflen -= s; while (i-- > 0) { - s = __strlen(r->r_aliases[i]) + 1; + s = strlen(r->r_aliases[i]) + 1; if (buflen < s) goto err_out; result_buf->r_aliases[i] = buffer; buffer += s; buflen -= s; - __memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); + memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); } /* copy the name */ - i = __strlen(r->r_name); + i = strlen(r->r_name); if (buflen <= i) goto err_out; result_buf->r_name = buffer; - __memcpy(result_buf->r_name, r->r_name, i); + memcpy(result_buf->r_name, r->r_name, i); /* that was a hoot eh ? */ *result = result_buf; @@ -328,7 +340,7 @@ int getrpcbynumber_r(int number, struct rpcent *result_buf, char *buffer, { int ret; LOCK; - ret = __copy_rpcent(__getrpcbynumber(number), result_buf, buffer, buflen, result); + ret = __copy_rpcent(getrpcbynumber(number), result_buf, buffer, buflen, result); UNLOCK; return ret; } @@ -338,7 +350,7 @@ int getrpcbyname_r(const char *name, struct rpcent *result_buf, char *buffer, { int ret; LOCK; - ret = __copy_rpcent(__getrpcbyname(name), result_buf, buffer, buflen, result); + ret = __copy_rpcent(getrpcbyname(name), result_buf, buffer, buflen, result); UNLOCK; return ret; } @@ -348,7 +360,7 @@ int getrpcent_r(struct rpcent *result_buf, char *buffer, { int ret; LOCK; - ret = __copy_rpcent(__getrpcent(), result_buf, buffer, buflen, result); + ret = __copy_rpcent(getrpcent(), result_buf, buffer, buflen, result); UNLOCK; return ret; } diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c index 48e58d9ab..82fa8d17a 100644 --- a/libc/inet/rpc/getrpcport.c +++ b/libc/inet/rpc/getrpcport.c @@ -35,9 +35,6 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI"; * Copyright (c) 1985 by Sun Microsystems, Inc. */ -#define pmap_getport __pmap_getport -#define gethostbyname_r __gethostbyname_r - #define __FORCE_GLIBC #include @@ -51,6 +48,10 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI"; #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(pmap_getport) +libc_hidden_proto(gethostbyname_r) + int getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto) { @@ -73,7 +74,7 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto) buffer = alloca (buflen); } - __memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); + memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); addr.sin_family = AF_INET; addr.sin_port = 0; return pmap_getport (&addr, prognum, versnum, proto); diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index 0c233dd19..8fe014186 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -34,10 +34,6 @@ * Client interface to pmap rpc service. */ -#define clnt_perror __clnt_perror -#define clntudp_bufcreate __clntudp_bufcreate -#define xdr_bool __xdr_bool - #define __FORCE_GLIBC #include @@ -52,6 +48,15 @@ #include #include +libc_hidden_proto(ioctl) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(perror) +libc_hidden_proto(exit) +libc_hidden_proto(clnt_perror) +libc_hidden_proto(clntudp_bufcreate) +libc_hidden_proto(xdr_bool) + /* * Same as get_myaddress, but we try to use the loopback * interface. portmap caches interfaces, and on DHCP clients, @@ -66,17 +71,17 @@ __get_myaddress (struct sockaddr_in *addr) struct ifreq ifreq, *ifr; int len, loopback = 1; - if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0) { - __perror ("__get_myaddress: socket"); - __exit (1); + perror ("__get_myaddress: socket"); + exit (1); } ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) + if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) { - __perror (_("__get_myaddress: ioctl (get interface configuration)")); - __exit (1); + perror (_("__get_myaddress: ioctl (get interface configuration)")); + exit (1); } again: @@ -84,17 +89,17 @@ __get_myaddress (struct sockaddr_in *addr) for (len = ifc.ifc_len; len; len -= sizeof ifreq) { ifreq = *ifr; - if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) { - __perror ("__get_myaddress: ioctl"); - __exit (1); + perror ("__get_myaddress: ioctl"); + exit (1); } if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET) && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0))) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - __close (s); + close (s); return TRUE; } ifr++; @@ -104,7 +109,7 @@ __get_myaddress (struct sockaddr_in *addr) loopback = 0; goto again; } - __close (s); + close (s); return FALSE; } @@ -116,8 +121,8 @@ static const struct timeval tottimeout = {60, 0}; * Set a mapping between program,version and port. * Calls the pmap service remotely to do the mapping. */ -bool_t attribute_hidden -__pmap_set (u_long program, u_long version, int protocol, u_short port) +bool_t +pmap_set (u_long program, u_long version, int protocol, u_short port) { struct sockaddr_in myaddress; int socket = -1; @@ -143,17 +148,18 @@ __pmap_set (u_long program, u_long version, int protocol, u_short port) return FALSE; } CLNT_DESTROY (client); - /* (void)__close(socket); CLNT_DESTROY closes it */ + /* (void)close(socket); CLNT_DESTROY closes it */ return rslt; } -strong_alias(__pmap_set,pmap_set) +libc_hidden_proto(pmap_set) +libc_hidden_def(pmap_set) /* * Remove the mapping between program,version and port. * Calls the pmap service remotely to do the un-mapping. */ -bool_t attribute_hidden -__pmap_unset (u_long program, u_long version) +bool_t +pmap_unset (u_long program, u_long version) { struct sockaddr_in myaddress; int socket = -1; @@ -173,7 +179,8 @@ __pmap_unset (u_long program, u_long version) CLNT_CALL (client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (caddr_t)&parms, (xdrproc_t)xdr_bool, (caddr_t)&rslt, tottimeout); CLNT_DESTROY (client); - /* (void)__close(socket); CLNT_DESTROY already closed it */ + /* (void)close(socket); CLNT_DESTROY already closed it */ return rslt; } -strong_alias(__pmap_unset,pmap_unset) +libc_hidden_proto(pmap_unset) +libc_hidden_def(pmap_unset) diff --git a/libc/inet/rpc/pmap_getmaps.c b/libc/inet/rpc/pmap_getmaps.c index 84736e03e..1ea3052ab 100644 --- a/libc/inet/rpc/pmap_getmaps.c +++ b/libc/inet/rpc/pmap_getmaps.c @@ -39,9 +39,6 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define clnt_perror __clnt_perror -#define clnttcp_create __clnttcp_create - #include #include #include @@ -50,6 +47,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro"; #include #include +libc_hidden_proto(clnt_perror) +libc_hidden_proto(clnttcp_create) + /* * Get a copy of the current port maps. * Calls the pmap service remotely to do get the maps. diff --git a/libc/inet/rpc/pmap_getport.c b/libc/inet/rpc/pmap_getport.c index b47baf35c..c841ee9ef 100644 --- a/libc/inet/rpc/pmap_getport.c +++ b/libc/inet/rpc/pmap_getport.c @@ -38,17 +38,13 @@ static char sccsid[] = "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define clntudp_bufcreate __clntudp_bufcreate - #include #include #include #include -#undef get_rpc_createerr -extern struct rpc_createerr *__rpc_thread_createerr_internal (void) - __attribute__ ((__const__)) attribute_hidden; -#define get_rpc_createerr() (*__rpc_thread_createerr_internal ()) +libc_hidden_proto(clntudp_bufcreate) +libc_hidden_proto(__rpc_thread_createerr) static const struct timeval timeout = {5, 0}; @@ -60,8 +56,8 @@ static const struct timeval tottimeout = * Calls the pmap service remotely to do the lookup. * Returns 0 if no map exists. */ -u_short attribute_hidden -__pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol) +u_short +pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_int protocol) { u_short port = 0; int socket = -1; @@ -95,4 +91,5 @@ __pmap_getport (struct sockaddr_in *address, u_long program, u_long version, u_i address->sin_port = 0; return port; } -strong_alias(__pmap_getport,pmap_getport) +libc_hidden_proto(pmap_getport) +libc_hidden_def(pmap_getport) diff --git a/libc/inet/rpc/pmap_prot.c b/libc/inet/rpc/pmap_prot.c index 388c8aeee..29f142ffa 100644 --- a/libc/inet/rpc/pmap_prot.c +++ b/libc/inet/rpc/pmap_prot.c @@ -38,12 +38,11 @@ static char sccsid[] = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define xdr_u_long __xdr_u_long - #include #include #include +libc_hidden_proto(xdr_u_long) bool_t xdr_pmap (xdrs, regs) diff --git a/libc/inet/rpc/pmap_prot2.c b/libc/inet/rpc/pmap_prot2.c index 655400f0c..187b19e8c 100644 --- a/libc/inet/rpc/pmap_prot2.c +++ b/libc/inet/rpc/pmap_prot2.c @@ -38,13 +38,12 @@ static char sccsid[] = "@(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define xdr_bool __xdr_bool -#define xdr_reference __xdr_reference - #include #include #include +libc_hidden_proto(xdr_bool) +libc_hidden_proto(xdr_reference) /* * What is going on with linked lists? (!) diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index dbba18378..9271bffd7 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -39,20 +39,6 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define authunix_create_default __authunix_create_default -#define xdrmem_create __xdrmem_create -#define xdr_callmsg __xdr_callmsg -#define xdr_replymsg __xdr_replymsg -#define xdr_reference __xdr_reference -#define xdr_u_long __xdr_u_long -#define inet_makeaddr __inet_makeaddr -#define inet_netof __inet_netof -#define clntudp_create __clntudp_create -#define setsockopt __setsockopt -#define recvfrom __recvfrom -#define sendto __sendto -#define poll __poll - #define __FORCE_GLIBC #include @@ -73,6 +59,27 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; #include #define MAX_BROADCAST_SIZE 1400 +libc_hidden_proto(memset) +libc_hidden_proto(ioctl) +libc_hidden_proto(perror) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(authunix_create_default) +libc_hidden_proto(xdrmem_create) +libc_hidden_proto(xdr_callmsg) +libc_hidden_proto(xdr_replymsg) +libc_hidden_proto(xdr_reference) +libc_hidden_proto(xdr_u_long) +libc_hidden_proto(inet_makeaddr) +libc_hidden_proto(inet_netof) +libc_hidden_proto(clntudp_create) +libc_hidden_proto(setsockopt) +libc_hidden_proto(recvfrom) +libc_hidden_proto(sendto) +libc_hidden_proto(poll) +libc_hidden_proto(fprintf) + + extern u_long _create_xid (void) attribute_hidden; static const struct timeval timeout = {3, 0}; @@ -81,8 +88,8 @@ static const struct timeval timeout = {3, 0}; * XDR remote call arguments * written for XDR_ENCODE direction only */ -bool_t attribute_hidden -__xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap) +bool_t +xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap) { u_int lenposition, argposition, position; @@ -106,7 +113,8 @@ __xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap) } return FALSE; } -strong_alias(__xdr_rmtcall_args,xdr_rmtcall_args) +libc_hidden_proto(xdr_rmtcall_args) +libc_hidden_def(xdr_rmtcall_args) /* * pmapper remote-call-service interface. @@ -142,7 +150,7 @@ pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_p r.port_ptr = port_ptr; r.results_ptr = resp; r.xdr_results = xdrres; - stat = CLNT_CALL (client, PMAPPROC_CALLIT, (xdrproc_t)__xdr_rmtcall_args, + stat = CLNT_CALL (client, PMAPPROC_CALLIT, (xdrproc_t)xdr_rmtcall_args, (caddr_t)&a, (xdrproc_t)xdr_rmtcallres, (caddr_t)&r, tout); CLNT_DESTROY (client); @@ -151,7 +159,7 @@ pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_p { stat = RPC_FAILED; } - /* (void)__close(socket); CLNT_DESTROY already closed it */ + /* (void)close(socket); CLNT_DESTROY already closed it */ addr->sin_port = 0; return stat; } @@ -198,18 +206,18 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf) ifc.ifc_len = UDPMSGSIZE; ifc.ifc_buf = buf; - if (__ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0) + if (ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0) { - __perror (_("broadcast: ioctl (get interface configuration)")); + perror (_("broadcast: ioctl (get interface configuration)")); return (0); } ifr = ifc.ifc_req; for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++) { ifreq = *ifr; - if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) { - __perror (_("broadcast: ioctl (get interface flags)")); + perror (_("broadcast: ioctl (get interface flags)")); continue; } if ((ifreq.ifr_flags & IFF_BROADCAST) && @@ -218,7 +226,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf) { sin = (struct sockaddr_in *) &ifr->ifr_addr; #ifdef SIOCGIFBRDADDR /* 4.3BSD */ - if (__ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0) + if (ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0) { addrs[i++] = inet_makeaddr (inet_netof /* Changed to pass struct instead of s_addr member @@ -277,16 +285,16 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) * initialization: create a socket, a broadcast address, and * preserialize the arguments into a send buffer. */ - if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) + if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { - __perror (_("Cannot create socket for broadcast rpc")); + perror (_("Cannot create socket for broadcast rpc")); stat = RPC_CANTSEND; goto done_broad; } #ifdef SO_BROADCAST if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0) { - __perror (_("Cannot set socket option SO_BROADCAST")); + perror (_("Cannot set socket option SO_BROADCAST")); stat = RPC_CANTSEND; goto done_broad; } @@ -294,7 +302,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) fd.fd = sock; fd.events = POLLIN; nets = getbroadcastnets (addrs, sock, inbuf); - __memset ((char *) &baddr, 0, sizeof (baddr)); + memset ((char *) &baddr, 0, sizeof (baddr)); baddr.sin_family = AF_INET; baddr.sin_port = htons (PMAPPORT); baddr.sin_addr.s_addr = htonl (INADDR_ANY); @@ -317,7 +325,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) r.xdr_results = xresults; r.results_ptr = resultsp; xdrmem_create (xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE); - if ((!xdr_callmsg (xdrs, &msg)) || (!__xdr_rmtcall_args (xdrs, &a))) + if ((!xdr_callmsg (xdrs, &msg)) || (!xdr_rmtcall_args (xdrs, &a))) { stat = RPC_CANTENCODEARGS; goto done_broad; @@ -337,7 +345,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) (struct sockaddr *) &baddr, sizeof (struct sockaddr)) != outlen) { - __perror (_("Cannot send broadcast packet")); + perror (_("Cannot send broadcast packet")); stat = RPC_CANTSEND; goto done_broad; } @@ -362,7 +370,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) case -1: /* some kind of error */ if (errno == EINTR) goto recv_again; - __perror (_("Broadcast poll problem")); + perror (_("Broadcast poll problem")); stat = RPC_CANTRECV; goto done_broad; @@ -375,7 +383,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) { if (errno == EINTR) goto try_again; - __perror (_("Cannot receive reply to broadcast")); + perror (_("Cannot receive reply to broadcast")); stat = RPC_CANTRECV; goto done_broad; } @@ -422,7 +430,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) } } done_broad: - (void) __close (sock); + (void) close (sock); AUTH_DESTROY (unix_auth); return stat; } diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index c76cf1ca7..4bdc8b3bc 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -35,28 +35,6 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #endif /* LIBC_SCCS and not lint */ -#define bcopy __bcopy -#define sysconf __sysconf -#define getline __getline -#define geteuid __geteuid -#define seteuid __seteuid -#define getpwnam_r __getpwnam_r -#define gethostbyname __gethostbyname -#define gethostbyname_r __gethostbyname_r -#define fileno __fileno -#define sleep __sleep -#define inet_addr __inet_addr -#define inet_ntoa __inet_ntoa -#define herror __herror -#define bind __bind -#define connect __connect -#define sigblock __sigblock -#define snprintf __snprintf -#define poll __poll -#define accept __accept -#define listen __listen -#define sigsetmask __sigsetmask - #define __FORCE_GLIBC #include @@ -79,9 +57,52 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include #include - -extern int __rresvport(int *alport) attribute_hidden; -extern int __getc_unlocked (FILE *__stream) attribute_hidden; +libc_hidden_proto(memcmp) +libc_hidden_proto(strcat) +libc_hidden_proto(strchr) +libc_hidden_proto(strcmp) +libc_hidden_proto(strcpy) +libc_hidden_proto(strlen) +libc_hidden_proto(strncmp) +libc_hidden_proto(strnlen) +libc_hidden_proto(bcopy) +libc_hidden_proto(getpid) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(fcntl) +libc_hidden_proto(read) +libc_hidden_proto(write) +libc_hidden_proto(perror) +libc_hidden_proto(lstat) +libc_hidden_proto(fstat) +libc_hidden_proto(tolower) +libc_hidden_proto(sysconf) +lib