summaryrefslogtreecommitdiff
path: root/libc/inet/rpc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/inet/rpc
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/inet/rpc')
-rw-r--r--libc/inet/rpc/auth_none.c13
-rw-r--r--libc/inet/rpc/auth_unix.c50
-rw-r--r--libc/inet/rpc/authunix_prot.c18
-rw-r--r--libc/inet/rpc/bindresvport.c17
-rw-r--r--libc/inet/rpc/clnt_generic.c30
-rw-r--r--libc/inet/rpc/clnt_perror.c101
-rw-r--r--libc/inet/rpc/clnt_raw.c19
-rw-r--r--libc/inet/rpc/clnt_simple.c18
-rw-r--r--libc/inet/rpc/clnt_tcp.c64
-rw-r--r--libc/inet/rpc/clnt_udp.c79
-rw-r--r--libc/inet/rpc/clnt_unix.c71
-rw-r--r--libc/inet/rpc/create_xid.c8
-rw-r--r--libc/inet/rpc/get_myaddress.c28
-rw-r--r--libc/inet/rpc/getrpcent.c96
-rw-r--r--libc/inet/rpc/getrpcport.c9
-rw-r--r--libc/inet/rpc/pmap_clnt.c53
-rw-r--r--libc/inet/rpc/pmap_getmaps.c6
-rw-r--r--libc/inet/rpc/pmap_getport.c15
-rw-r--r--libc/inet/rpc/pmap_prot.c3
-rw-r--r--libc/inet/rpc/pmap_prot2.c5
-rw-r--r--libc/inet/rpc/pmap_rmt.c74
-rw-r--r--libc/inet/rpc/rcmd.c159
-rw-r--r--libc/inet/rpc/rexec.c95
-rw-r--r--libc/inet/rpc/rpc_callmsg.c28
-rw-r--r--libc/inet/rpc/rpc_dtablesize.c11
-rw-r--r--libc/inet/rpc/rpc_private.h5
-rw-r--r--libc/inet/rpc/rpc_prot.c52
-rw-r--r--libc/inet/rpc/rpc_thread.c48
-rw-r--r--libc/inet/rpc/rtime.c19
-rw-r--r--libc/inet/rpc/ruserpass.c123
-rw-r--r--libc/inet/rpc/svc.c131
-rw-r--r--libc/inet/rpc/svc_auth.c7
-rw-r--r--libc/inet/rpc/svc_auth_unix.c12
-rw-r--r--libc/inet/rpc/svc_raw.c8
-rw-r--r--libc/inet/rpc/svc_run.c16
-rw-r--r--libc/inet/rpc/svc_simple.c34
-rw-r--r--libc/inet/rpc/svc_tcp.c59
-rw-r--r--libc/inet/rpc/svc_udp.c78
-rw-r--r--libc/inet/rpc/svc_unix.c72
-rw-r--r--libc/inet/rpc/xdr.c137
-rw-r--r--libc/inet/rpc/xdr_array.c19
-rw-r--r--libc/inet/rpc/xdr_mem.c13
-rw-r--r--libc/inet/rpc/xdr_rec.c43
-rw-r--r--libc/inet/rpc/xdr_reference.c21
-rw-r--r--libc/inet/rpc/xdr_stdio.c12
45 files changed, 1092 insertions, 887 deletions
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 <features.h>
#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 <features.h>
@@ -67,6 +56,23 @@
# include <wchar.h>
#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 <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include <rpc/auth_unix.h>
+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 <features.h>
@@ -42,11 +40,15 @@
#include <sys/socket.h>
#include <netinet/in.h>
+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 <features.h>
@@ -46,10 +40,16 @@
#include <sys/socket.h>
#include <netdb.h>
-#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 <features.h>
@@ -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 <features.h>
#include "rpc_private.h"
#include <rpc/svc.h>
#include <rpc/xdr.h>
+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 <features.h>
@@ -53,6 +50,13 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
#include <netdb.h>
#include <string.h>
+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 <features.h>
@@ -80,12 +65,30 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
# include <wchar.h>
#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 <features.h>
@@ -72,6 +54,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
#include <net/if.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
+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 <sys/uio.h>
#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 <features.h>
@@ -78,14 +60,34 @@
#include <rpc/pmap_clnt.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
+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 <features.h>
@@ -29,6 +25,10 @@
#include <sys/time.h>
#include <rpc/rpc.h>
+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 <netinet/in.h>
#include <arpa/inet.h>
+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 <features.h>
#include <stdio.h>
@@ -48,6 +44,17 @@
#include <arpa/inet.h>
#include <errno.h>
+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 <features.h>
@@ -51,6 +48,10 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
+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 <features.h>
@@ -52,6 +48,15 @@
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
+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 <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
@@ -50,6 +47,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
#include <stdio.h>
#include <errno.h>
+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 <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
-#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 <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
+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 <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/pmap_prot.h>
+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 <features.h>
@@ -73,6 +59,27 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
#include <arpa/inet.h>
#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 <features.h>
@@ -79,9 +57,52 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <netinet/in.h>
#include <arpa/inet.h>
-
-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)
+libc_hidden_proto(getline)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(seteuid)
+libc_hidden_proto(getpwnam_r)
+libc_hidden_proto(gethostbyname)
+libc_hidden_proto(gethostbyname_r)
+libc_hidden_proto(fileno)
+libc_hidden_proto(sleep)
+libc_hidden_proto(inet_addr)
+libc_hidden_proto(inet_ntoa)
+libc_hidden_proto(herror)
+libc_hidden_proto(bind)
+libc_hidden_proto(connect)
+libc_hidden_proto(sigblock)
+libc_hidden_proto(snprintf)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(sigsetmask)
+libc_hidden_proto(getc_unlocked)
+libc_hidden_proto(__fgetc_unlocked)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(fprintf)
+
+libc_hidden_proto(rresvport)
/* some forward declarations */
static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
@@ -110,7 +131,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
int s, lport, timo;
char c;
- pid = __getpid();
+ pid = getpid();
#ifdef __UCLIBC_HAS_REENTRANT_RPC__
hstbuflen = 1024;
@@ -160,7 +181,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
*ahost = hp->h_name;
oldmask = sigblock(sigmask(SIGURG)); /* __sigblock */
for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
- s = __rresvport(&lport);
+ s = rresvport(&lport);
if (s < 0) {
if (errno == EAGAIN)
(void)fprintf(stderr,
@@ -170,14 +191,14 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
sigsetmask(oldmask); /* sigsetmask */
return -1;
}
- __fcntl(s, F_SETOWN, pid); /* __fcntl */
+ fcntl(s, F_SETOWN, pid);
sin.sin_family = hp->h_addrtype;
bcopy(hp->h_addr_list[0], &sin.sin_addr,
MIN (sizeof (sin.sin_addr), hp->h_length));
sin.sin_port = rport;
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) /* __connect */
break;
- (void)__close(s);
+ (void)close(s);
if (errno == EADDRINUSE) {
lport--;
continue;
@@ -193,7 +214,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
(void)fprintf(stderr, "connect to address %s: ",
inet_ntoa(sin.sin_addr));
__set_errno (oerrno);
- __perror(0);
+ perror(0);
hp->h_addr_list++;
bcopy(hp->h_addr_list[0], &sin.sin_addr,
MIN (sizeof (sin.sin_addr), hp->h_length));
@@ -207,21 +228,21 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
}
lport--;
if (fd2p == 0) {
- __write(s, "", 1);
+ write(s, "", 1);
lport = 0;
} else {
char num[8];
- int s2 = __rresvport(&lport), s3;
+ int s2 = rresvport(&lport), s3;
socklen_t len = sizeof(from);
if (s2 < 0)
goto bad;
listen(s2, 1);
(void)snprintf(num, sizeof(num), "%d", lport); /* __snprintf */
- if (__write(s, num, __strlen(num)+1) != __strlen(num)+1) {
+ if (write(s, num, strlen(num)+1) != strlen(num)+1) {
(void)fprintf(stderr,
"rcmd: write (setting up stderr): %m\n");
- (void)__close(s2);
+ (void)close(s2);
goto bad;
}
pfd[0].fd = s;
@@ -232,11 +253,11 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
(void)fprintf(stderr, "rcmd: poll (setting up stderr): %m\n");
else
(void)fprintf(stderr, "poll: protocol failure in circuit setup\n");
- (void)__close(s2);
+ (void)close(s2);
goto bad;
}
s3 = accept(s2, (struct sockaddr *)&from, &len);
- (void)__close(s2);
+ (void)close(s2);
if (s3 < 0) {
(void)fprintf(stderr,
"rcmd: accept: %m\n");
@@ -253,17 +274,17 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
goto bad2;
}
}
- (void)__write(s, locuser, __strlen(locuser)+1);
- (void)__write(s, remuser, __strlen(remuser)+1);
- (void)__write(s, cmd, __strlen(cmd)+1);
- if (__read(s, &c, 1) != 1) {
+ (void)write(s, locuser, strlen(locuser)+1);
+ (void)write(s, remuser, strlen(remuser)+1);
+ (void)write(s, cmd, strlen(cmd)+1);
+ if (read(s, &c, 1) != 1) {
(void)fprintf(stderr,
"rcmd: %s: %m\n", *ahost);
goto bad2;
}
if (c != 0) {
- while (__read(s, &c, 1) == 1) {
- (void)__write(STDERR_FILENO, &c, 1);
+ while (read(s, &c, 1) == 1) {
+ (void)write(STDERR_FILENO, &c, 1);
if (c == '\n')
break;
}
@@ -273,21 +294,21 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
return s;
bad2:
if (lport)
- (void)__close(*fd2p);
+ (void)close(*fd2p);
bad:
- (void)__close(s);
+ (void)close(s);
sigsetmask(oldmask);
return -1;
}
-int attribute_hidden __rresvport(int *alport)
+int rresvport(int *alport)
{
struct sockaddr_in sin;
int s;
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
- s = __socket(AF_INET, SOCK_STREAM, 0);
+ s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
return -1;
for (;;) {
@@ -295,12 +316,12 @@ int attribute_hidden __rresvport(int *alport)
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
return s;
if (errno != EADDRINUSE) {
- (void)__close(s);
+ (void)close(s);
return -1;
}
(*alport)--;
if (*alport == IPPORT_RESERVED/2) {
- (void)__close(s);
+ (void)close(s);
__set_errno (EAGAIN); /* close */
return -1;
}
@@ -308,7 +329,7 @@ int attribute_hidden __rresvport(int *alport)
return -1;
}
-strong_alias(__rresvport,rresvport)
+libc_hidden_def(rresvport)
static int __check_rhosts_file = 1;
static char *__rcmd_errstr;
@@ -386,7 +407,7 @@ iruserfopen (char *file, uid_t okuser)
root, if writeable by anyone but the owner, or if hardlinked
anywhere, quit. */
cp = NULL;
- if (__lstat (file, &st))
+ if (lstat (file, &st))
cp = "lstat failed";
else if (!S_ISREG (st.st_mode))
cp = "not regular file";
@@ -395,7 +416,7 @@ iruserfopen (char *file, uid_t okuser)
res = fopen (file, "r");
if (!res)
cp = "cannot open";
- else if (__fstat (fileno (res), &st) < 0)
+ else if (fstat (fileno (res), &st) < 0)
cp = "fstat failed";
else if (st.st_uid && st.st_uid != okuser)
cp = "bad owner";
@@ -478,10 +499,10 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
return -1;
#endif
- dirlen = __strlen (pwd->pw_dir);
+ dirlen = strlen (pwd->pw_dir);
pbuf = malloc (dirlen + sizeof "/.rhosts");
- __strcpy (pbuf, pwd->pw_dir);
- __strcat (pbuf, "/.rhosts");
+ strcpy (pbuf, pwd->pw_dir);
+ strcat (pbuf, "/.rhosts");
/* Change effective uid while reading .rhosts. If root and
reading an NFS mounted file system, can't read files that
@@ -546,18 +567,18 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
#ifdef HAVE_NETGROUP
/* Check nis netgroup. */
- if (__strncmp ("+@", lhost, 2) == 0)
+ if (strncmp ("+@", lhost, 2) == 0)
return innetgr (&lhost[2], rhost, NULL, NULL);
- if (__strncmp ("-@", lhost, 2) == 0)
+ if (strncmp ("-@", lhost, 2) == 0)
return -innetgr (&lhost[2], rhost, NULL, NULL);
#endif /* HAVE_NETGROUP */
/* -host */
- if (__strncmp ("-", lhost,1) == 0) {
+ if (strncmp ("-", lhost,1) == 0) {
negate = -1;
lhost++;
- } else if (__strcmp ("+",lhost) == 0) {
+ } else if (strcmp ("+",lhost) == 0) {
return 1; /* asking for trouble, but ok.. */
}
@@ -587,7 +608,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
/* Spin through ip addresses. */
for (pp = hp->h_addr_list; *pp; ++pp)
- if (!__memcmp (&raddr, *pp, sizeof (u_int32_t)))
+ if (!memcmp (&raddr, *pp, sizeof (u_int32_t)))
return negate;
/* No match. */
@@ -606,23 +627,23 @@ __icheckuser (const char *luser, const char *ruser)
#ifdef HAVE_NETGROUP
/* [-+]@netgroup */
- if (__strncmp ("+@", luser, 2) == 0)
+ if (strncmp ("+@", luser, 2) == 0)
return innetgr (&luser[2], NULL, ruser, NULL);
- if (__strncmp ("-@", luser,2) == 0)
+ if (strncmp ("-@", luser,2) == 0)
return -innetgr (&luser[2], NULL, ruser, NULL);
#endif /* HAVE_NETGROUP */
/* -user */
- if (__strncmp ("-", luser, 1) == 0)
- return -(__strcmp (&luser[1], ruser) == 0);
+ if (strncmp ("-", luser, 1) == 0)
+ return -(strcmp (&luser[1], ruser) == 0);
/* + */
- if (__strcmp ("+", luser) == 0)
+ if (strcmp ("+", luser) == 0)
return 1;
/* simple string match */
- return __strcmp (ruser, luser) == 0;
+ return strcmp (ruser, luser) == 0;
}
/*
@@ -664,16 +685,16 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost)
}
/* Skip lines that are too long. */
- if (__strchr (p, '\n') == NULL) {
- int ch = __getc_unlocked (hostf);
+ if (strchr (p, '\n') == NULL) {
+ int ch = getc_unlocked (hostf);
while (ch != '\n' && ch != EOF)
- ch = __getc_unlocked (hostf);
+ ch = getc_unlocked (hostf);
continue;
}
for (;*p && !isspace(*p); ++p) {
- *p = __tolower (*p);
+ *p = tolower (*p);
}
/* Next we want to find the permitted name for the remote user. */
diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c
index a90776fc4..305eaffff 100644
--- a/libc/inet/rpc/rexec.c
+++ b/libc/inet/rpc/rexec.c
@@ -27,17 +27,6 @@
* SUCH DAMAGE.
*/
-#define getsockname __getsockname
-#define getnameinfo __getnameinfo
-#define getaddrinfo __getaddrinfo
-#define freeaddrinfo __freeaddrinfo
-#define sleep __sleep
-#define atoi __atoi
-#define connect __connect
-#define snprintf __snprintf
-#define accept __accept
-#define listen __listen
-
#define __FORCE_GLIBC
#include <features.h>
#include <sys/types.h>
@@ -53,15 +42,36 @@
#include <string.h>
#include <unistd.h>
+libc_hidden_proto(memset)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncpy)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(close)
+libc_hidden_proto(socket)
+libc_hidden_proto(perror)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(snprintf)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(getnameinfo)
+libc_hidden_proto(getaddrinfo)
+libc_hidden_proto(freeaddrinfo)
+libc_hidden_proto(sleep)
+libc_hidden_proto(atoi)
+libc_hidden_proto(connect)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+
#define SA_LEN(_x) __libc_sa_len((_x)->sa_family)
extern int __libc_sa_len (sa_family_t __af) __THROW attribute_hidden;
int rexecoptions;
char ahostbuf[NI_MAXHOST] attribute_hidden;
-extern int __ruserpass(const char *host, const char **aname, const char **apass) attribute_hidden;
+extern int ruserpass(const char *host, const char **aname, const char **apass) attribute_hidden;
+libc_hidden_proto(ruserpass)
-int attribute_hidden
-__rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
+int
+rexec_af(char **ahost, int rport, const char *name, const char *pass, const char *cmd, int *fd2p, sa_family_t af)
{
struct sockaddr_storage sa2, from;
struct addrinfo hints, *res0;
@@ -76,7 +86,7 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport));
servbuff[sizeof(servbuff) - 1] = '\0';
- __memset(&hints, 0, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = af;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
@@ -87,51 +97,51 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
}
if (res0->ai_canonname){
- __strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf));
+ strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf));
ahostbuf[sizeof(ahostbuf)-1] = '\0';
*ahost = ahostbuf;
}
else{
*ahost = NULL;
}
- __ruserpass(res0->ai_canonname, &name, &pass);
+ ruserpass(res0->ai_canonname, &name, &pass);
retry:
- s = __socket(res0->ai_family, res0->ai_socktype, 0);
+ s = socket(res0->ai_family, res0->ai_socktype, 0);
if (s < 0) {
- __perror("rexec: socket");
+ perror("rexec: socket");
return (-1);
}
if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) {
if (errno == ECONNREFUSED && timo <= 16) {
- (void) __close(s);
+ (void) close(s);
sleep(timo);
timo *= 2;
goto retry;
}
- __perror(res0->ai_canonname);
+ perror(res0->ai_canonname);
return (-1);
}
if (fd2p == 0) {
- (void) __write(s, "", 1);
+ (void) write(s, "", 1);
port = 0;
} else {
char num[32];
int s2, sa2len;
- s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
+ s2 = socket(res0->ai_family, res0->ai_socktype, 0);
if (s2 < 0) {
- (void) __close(s);
+ (void) close(s);
return (-1);
}
listen(s2, 1);
sa2len = sizeof (sa2);
if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
- __perror("getsockname");
- (void) __close(s2);
+ perror("getsockname");
+ (void) close(s2);
goto bad;
} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
__set_errno(EINVAL);
- (void) __close(s2);
+ (void) close(s2);
goto bad;
}
port = 0;
@@ -139,23 +149,23 @@ retry:
NULL, 0, servbuff, sizeof(servbuff),
NI_NUMERICSERV))
port = atoi(servbuff);
- (void) __sprintf(num, "%u", port);
- (void) __write(s, num, __strlen(num)+1);
+ (void) sprintf(num, "%u", port);
+ (void) write(s, num, strlen(num)+1);
{ socklen_t len = sizeof (from);
s3 = accept(s2, (struct sockaddr *)&from, &len);
- __close(s2);
+ close(s2);
if (s3 < 0) {
- __perror("accept");
+ perror("accept");
port = 0;
goto bad;
}
}
*fd2p = s3;
}
- (void) __write(s, name, __strlen(name) + 1);
+ (void) write(s, name, strlen(name) + 1);
/* should public key encypt the password here */
- (void) __write(s, pass, __strlen(pass) + 1);
- (void) __write(s, cmd, __strlen(cmd) + 1);
+ (void) write(s, pass, strlen(pass) + 1);
+ (void) write(s, cmd, strlen(cmd) + 1);
/* We don't need the memory allocated for the name and the password
in ruserpass anymore. */
@@ -164,13 +174,13 @@ retry:
if (pass != orig_pass)
free ((char *) pass);
- if (__read(s, &c, 1) != 1) {
- __perror(*ahost);
+ if (read(s, &c, 1) != 1) {
+ perror(*ahost);
goto bad;
}
if (c != 0) {
- while (__read(s, &c, 1) == 1) {
- (void) __write(2, &c, 1);
+ while (read(s, &c, 1) == 1) {
+ (void) write(2, &c, 1);
if (c == '\n')
break;
}
@@ -180,12 +190,13 @@ retry:
return (s);
bad:
if (port)
- (void) __close(*fd2p);
- (void) __close(s);
+ (void) close(*fd2p);
+ (void) close(s);
freeaddrinfo(res0);
return (-1);
}
-strong_alias(__rexec_af,rexec_af)
+libc_hidden_proto(rexec_af)
+libc_hidden_def(rexec_af)
int
rexec(ahost, rport, name, pass, cmd, fd2p)
@@ -194,5 +205,5 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
const char *name, *pass, *cmd;
int *fd2p;
{
- return __rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
+ return rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
}
diff --git a/libc/inet/rpc/rpc_callmsg.c b/libc/inet/rpc/rpc_callmsg.c
index 6368e5920..5473ba743 100644
--- a/libc/inet/rpc/rpc_callmsg.c
+++ b/libc/inet/rpc/rpc_callmsg.c
@@ -38,12 +38,6 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
*
*/
-#define xdr_enum __xdr_enum
-#define xdr_opaque __xdr_opaque
-#define xdr_u_int __xdr_u_int
-#define xdr_u_long __xdr_u_long
-#define xdr_opaque_auth __xdr_opaque_auth
-
#define __FORCE_GLIBC
#include <features.h>
@@ -51,11 +45,18 @@ static char sccsid[] = "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
#include <sys/param.h>
#include <rpc/rpc.h>
+libc_hidden_proto(memcpy)
+libc_hidden_proto(xdr_enum)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_proto(xdr_u_int)
+libc_hidden_proto(xdr_u_long)
+libc_hidden_proto(xdr_opaque_auth)
+
/*
* XDR a call message
*/
-bool_t attribute_hidden
-__xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
+bool_t
+xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
{
int32_t *buf;
struct opaque_auth *oa;
@@ -91,7 +92,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
IXDR_PUT_INT32 (buf, oa->oa_length);
if (oa->oa_length)
{
- __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
+ memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
buf = (int32_t *) ((char *) buf + RNDUP (oa->oa_length));
}
oa = &cmsg->rm_call.cb_verf;
@@ -99,7 +100,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
IXDR_PUT_INT32 (buf, oa->oa_length);
if (oa->oa_length)
{
- __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
+ memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length);
/* no real need....
buf = (long *) ((char *) buf + RNDUP(oa->oa_length));
*/
@@ -147,7 +148,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
}
else
{
- __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
+ memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
/* no real need....
buf = (long *) ((char *) buf
+ RNDUP(oa->oa_length));
@@ -187,7 +188,7 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
}
else
{
- __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
+ memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length);
/* no real need...
buf = (long *) ((char *) buf
+ RNDUP(oa->oa_length));
@@ -210,4 +211,5 @@ __xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg)
return xdr_opaque_auth (xdrs, &(cmsg->rm_call.cb_verf));
return FALSE;
}
-strong_alias(__xdr_callmsg,xdr_callmsg)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_def(xdr_callmsg)
diff --git a/libc/inet/rpc/rpc_dtablesize.c b/libc/inet/rpc/rpc_dtablesize.c
index ede7120b3..09e08b48a 100644
--- a/libc/inet/rpc/rpc_dtablesize.c
+++ b/libc/inet/rpc/rpc_dtablesize.c
@@ -31,8 +31,6 @@
static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
#endif
-#define getdtablesize __getdtablesize
-
#define __FORCE_GLIBC
#define __USE_BSD
#include <features.h>
@@ -40,12 +38,14 @@ static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
#include <unistd.h>
#include <rpc/clnt.h>
+libc_hidden_proto(getdtablesize)
+
/*
* Cache the result of getdtablesize(), so we don't have to do an
* expensive system call every time.
*/
-int attribute_hidden
-_rpc_dtablesize_internal (void)
+int
+_rpc_dtablesize(void)
{
static int size;
@@ -54,4 +54,5 @@ _rpc_dtablesize_internal (void)
return size;
}
-strong_alias(_rpc_dtablesize_internal,_rpc_dtablesize)
+libc_hidden_proto(_rpc_dtablesize)
+libc_hidden_def(_rpc_dtablesize)
diff --git a/libc/inet/rpc/rpc_private.h b/libc/inet/rpc/rpc_private.h
index d899b401d..15250059a 100644
--- a/libc/inet/rpc/rpc_private.h
+++ b/libc/inet/rpc/rpc_private.h
@@ -4,10 +4,7 @@
/* Now define the internal interfaces. */
extern u_long _create_xid (void) attribute_hidden;
-#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(__rpc_thread_createerr)
/*
* Multi-threaded support
diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c
index ee6c03644..f6453950b 100644
--- a/libc/inet/rpc/rpc_prot.c
+++ b/libc/inet/rpc/rpc_prot.c
@@ -44,12 +44,6 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
* routines are also in this program.
*/
-#define xdr_bytes __xdr_bytes
-#define xdr_union __xdr_union
-#define xdr_enum __xdr_enum
-#define xdr_opaque __xdr_opaque
-#define xdr_u_long __xdr_u_long
-
#define __FORCE_GLIBC
#include <features.h>
@@ -57,14 +51,20 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
#include <rpc/rpc.h>
+libc_hidden_proto(xdr_bytes)
+libc_hidden_proto(xdr_union)
+libc_hidden_proto(xdr_enum)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_proto(xdr_u_long)
+
/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
/*
* XDR an opaque authentication struct
* (see auth.h)
*/
-bool_t attribute_hidden
-__xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
+bool_t
+xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
{
if (xdr_enum (xdrs, &(ap->oa_flavor)))
@@ -72,7 +72,8 @@ __xdr_opaque_auth (XDR *xdrs, struct opaque_auth *ap)
&ap->oa_length, MAX_AUTH_BYTES);
return FALSE;
}
-strong_alias(__xdr_opaque_auth,xdr_opaque_auth)
+libc_hidden_proto(xdr_opaque_auth)
+libc_hidden_def(xdr_opaque_auth)
/*
* XDR a DES block
@@ -92,7 +93,7 @@ bool_t
xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
{
/* personalized union, rather than calling xdr_union */
- if (!__xdr_opaque_auth (xdrs, &(ar->ar_verf)))
+ if (!xdr_opaque_auth (xdrs, &(ar->ar_verf)))
return FALSE;
if (!xdr_enum (xdrs, (enum_t *) & (ar->ar_stat)))
return FALSE;
@@ -109,7 +110,8 @@ xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar)
}
return TRUE; /* TRUE => open ended set of problems */
}
-hidden_strong_alias(xdr_accepted_reply,__xdr_accepted_reply)
+libc_hidden_proto(xdr_accepted_reply)
+libc_hidden_def(xdr_accepted_reply)
/*
* XDR the MSG_DENIED part of a reply message union
@@ -132,19 +134,20 @@ xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr)
}
return FALSE;
}
-hidden_strong_alias(xdr_rejected_reply,__xdr_rejected_reply)
+libc_hidden_proto(xdr_rejected_reply)
+libc_hidden_def(xdr_rejected_reply)
static const struct xdr_discrim reply_dscrm[3] =
{
- {(int) MSG_ACCEPTED, (xdrproc_t) __xdr_accepted_reply},
- {(int) MSG_DENIED, (xdrproc_t) __xdr_rejected_reply},
+ {(int) MSG_ACCEPTED, (xdrproc_t) xdr_accepted_reply},
+ {(int) MSG_DENIED, (xdrproc_t) xdr_rejected_reply},
{__dontcare__, NULL_xdrproc_t}};
/*
* XDR a reply message
*/
-bool_t attribute_hidden
-__xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
+bool_t
+xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
{
if (xdr_u_long (xdrs, &(rmsg->rm_xid)) &&
xdr_enum (xdrs, (enum_t *) & (rmsg->rm_direction)) &&
@@ -154,7 +157,8 @@ __xdr_replymsg (XDR *xdrs, struct rpc_msg *rmsg)
NULL_xdrproc_t);
return FALSE;
}
-strong_alias(__xdr_replymsg,xdr_replymsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_def(xdr_replymsg)
/*
@@ -162,8 +166,8 @@ strong_alias(__xdr_replymsg,xdr_replymsg)
* The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
* The rm_xid is not really static, but the user can easily munge on the fly.
*/
-bool_t attribute_hidden
-__xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
+bool_t
+xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
{
cmsg->rm_direction = CALL;
@@ -177,7 +181,8 @@ __xdr_callhdr (XDR *xdrs, struct rpc_msg *cmsg)
return xdr_u_long (xdrs, &(cmsg->rm_call.cb_vers));
return FALSE;
}
-strong_alias(__xdr_callhdr,xdr_callhdr)
+libc_hidden_proto(xdr_callhdr)
+libc_hidden_def(xdr_callhdr)
/* ************************** Client utility routine ************* */
@@ -242,8 +247,8 @@ rejected (enum reject_stat rjct_stat,
/*
* given a reply message, fills in the error
*/
-void attribute_hidden
-__seterr_reply (struct rpc_msg *msg,
+void
+_seterr_reply (struct rpc_msg *msg,
struct rpc_err *error)
{
/* optimized for normal, SUCCESSful case */
@@ -287,4 +292,5 @@ __seterr_reply (struct rpc_msg *msg,
break;
}
}
-strong_alias(__seterr_reply,_seterr_reply)
+libc_hidden_proto(_seterr_reply)
+libc_hidden_def(_seterr_reply)
diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c
index 4a7d9b044..70ed62262 100644
--- a/libc/inet/rpc/rpc_thread.c
+++ b/libc/inet/rpc/rpc_thread.c
@@ -1,3 +1,9 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
#define __FORCE_GLIBC
#include <features.h>
#include <stdio.h>
@@ -76,8 +82,8 @@ __rpc_thread_variables (void)
#undef svc_pollfd
#undef svc_max_pollfd
-fd_set attribute_hidden *
-__rpc_thread_svc_fdset_internal (void)
+fd_set *
+__rpc_thread_svc_fdset (void)
{
struct rpc_thread_variables *tvp;
@@ -86,10 +92,9 @@ __rpc_thread_svc_fdset_internal (void)
return &svc_fdset;
return &tvp->svc_fdset_s;
}
-strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
-struct rpc_createerr attribute_hidden *
-__rpc_thread_createerr_internal (void)
+struct rpc_createerr *
+__rpc_thread_createerr (void)
{
struct rpc_thread_variables *tvp;
@@ -98,11 +103,9 @@ __rpc_thread_createerr_internal (void)
return &rpc_createerr;
return &tvp->rpc_createerr_s;
}
-#undef __rpc_thread_createerr
-strong_alias(__rpc_thread_createerr_internal,__rpc_thread_createerr)
-struct pollfd attribute_hidden **
-__rpc_thread_svc_pollfd_internal (void)
+struct pollfd **
+__rpc_thread_svc_pollfd (void)
{
struct rpc_thread_variables *tvp;
@@ -111,10 +114,9 @@ __rpc_thread_svc_pollfd_internal (void)
return &svc_pollfd;
return &tvp->svc_pollfd_s;
}
-strong_alias(__rpc_thread_svc_pollfd_internal,__rpc_thread_svc_pollfd)
-int attribute_hidden *
-__rpc_thread_svc_max_pollfd_internal (void)
+int *
+__rpc_thread_svc_max_pollfd (void)
{
struct rpc_thread_variables *tvp;
@@ -123,7 +125,6 @@ __rpc_thread_svc_max_pollfd_internal (void)
return &svc_max_pollfd;
return &tvp->svc_max_pollfd_s;
}
-strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
#else
#undef svc_fdset
@@ -131,34 +132,37 @@ strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
#undef svc_pollfd
#undef svc_max_pollfd
-fd_set attribute_hidden * __rpc_thread_svc_fdset_internal (void)
+fd_set * __rpc_thread_svc_fdset (void)
{
extern fd_set svc_fdset;
return &(svc_fdset);
}
-strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
-struct rpc_createerr attribute_hidden * __rpc_thread_createerr_internal (void)
+struct rpc_createerr * __rpc_thread_createerr (void)
{
extern struct rpc_createerr rpc_createerr;
return &(rpc_createerr);
}
-#undef __rpc_thread_createerr
-strong_alias(__rpc_thread_createerr_internal,__rpc_thread_createerr)
-struct pollfd attribute_hidden ** __rpc_thread_svc_pollfd_internal (void)
+struct pollfd ** __rpc_thread_svc_pollfd (void)
{
extern struct pollfd *svc_pollfd;
return &(svc_pollfd);
}
-strong_alias(__rpc_thread_svc_pollfd_internal,__rpc_thread_svc_pollfd)
-int attribute_hidden * __rpc_thread_svc_max_pollfd_internal (void)
+int * __rpc_thread_svc_max_pollfd (void)
{
extern int svc_max_pollfd;
return &(svc_max_pollfd);
}
-strong_alias(__rpc_thread_svc_max_pollfd_internal,__rpc_thread_svc_max_pollfd)
#endif /* __UCLIBC_HAS_THREADS__ */
+libc_hidden_proto(__rpc_thread_svc_fdset)
+libc_hidden_def(__rpc_thread_svc_fdset)
+libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_def(__rpc_thread_createerr)
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_def(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+libc_hidden_def(__rpc_thread_svc_max_pollfd)
diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c
index b4bbca19c..fc4cfe548 100644
--- a/libc/inet/rpc/rtime.c
+++ b/libc/inet/rpc/rtime.c
@@ -43,11 +43,6 @@ static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S
* what unix uses.
*/
-#define connect __connect
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define poll __poll
-
#define __FORCE_GLIBC
#include <features.h>
@@ -63,6 +58,14 @@ static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S
#include <errno.h>
#include <netinet/in.h>
+libc_hidden_proto(read)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(connect)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(poll)
+
#define NYEARS (u_long)(1970 - 1900)
#define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))
@@ -74,7 +77,7 @@ do_close (int s)
int save;
save = errno;
- __close (s);
+ close (s);
__set_errno (save);
}
@@ -96,7 +99,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
else
type = SOCK_DGRAM;
- s = __socket (AF_INET, type, 0);
+ s = socket (AF_INET, type, 0);
if (s < 0)
return (-1);
@@ -138,7 +141,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
do_close (s);
return -1;
}
- res = __read (s, (char *) &thetime, sizeof (thetime));
+ res = read (s, (char *) &thetime, sizeof (thetime));
do_close (s);
if (res < 0)
return (-1);
diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c
index 728ea5bb7..61008b9ec 100644
--- a/libc/inet/rpc/ruserpass.c
+++ b/libc/inet/rpc/ruserpass.c
@@ -27,14 +27,6 @@
* SUCH DAMAGE.
*/
-#define __fsetlocking __fsetlocking_internal
-#define getgid __getgid
-#define getuid __getuid
-#define getegid __getegid
-#define geteuid __geteuid
-#define gethostname __gethostname
-#define fileno __fileno
-
#define __FORCE_GLIBC
#include <features.h>
#include <sys/types.h>
@@ -50,7 +42,27 @@
#include <string.h>
#include <unistd.h>
-extern int __getc_unlocked (FILE *__stream) attribute_hidden;
+libc_hidden_proto(strcat)
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strcasecmp)
+libc_hidden_proto(strncasecmp)
+libc_hidden_proto(getenv)
+libc_hidden_proto(printf)
+libc_hidden_proto(fstat)
+libc_hidden_proto(__fsetlocking)
+libc_hidden_proto(getgid)
+libc_hidden_proto(getuid)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(gethostname)
+libc_hidden_proto(fileno)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(getc_unlocked)
+libc_hidden_proto(__fgetc_unlocked)
#define _(X) (X)
/* #include "ftp_var.h" */
@@ -101,7 +113,7 @@ static const struct toktab {
-int attribute_hidden __ruserpass(const char *host, const char **aname, const char **apass)
+int ruserpass(const char *host, const char **aname, const char **apass)
{
char *hdir, *buf, *tmp;
char myname[1024], *mydomain;
@@ -111,20 +123,20 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha
/* Give up when running a setuid or setgid app. */
if ((getuid() != geteuid()) || getgid() != getegid())
return -1;
- hdir = __getenv("HOME");
+ hdir = getenv("HOME");
if (hdir == NULL) {
/* If we can't get HOME, fail instead of trying ".",
which is no improvement. */
return -1;
}
- buf = alloca (__strlen(hdir) + 8);
- __strcpy(buf, hdir);
- __strcat(buf, "/.netrc");
+ buf = alloca (strlen(hdir) + 8);
+ strcpy(buf, hdir);
+ strcat(buf, "/.netrc");
cfile = fopen(buf, "r");
if (cfile == NULL) {
if (errno != ENOENT)
- __printf("%s", buf);
+ printf("%s", buf);
return (0);
}
/* No threads use this stream. */
@@ -133,9 +145,9 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha
#endif
if (gethostname(myname, sizeof(myname)) < 0)
myname[0] = '\0';
- mydomain = __strchr(myname, '.');
+ mydomain = strchr(myname, '.');
if (mydomain==NULL) {
- mydomain=myname + __strlen(myname);
+ mydomain=myname + strlen(myname);
}
next:
while ((t = token())) switch(t) {
@@ -153,11 +165,11 @@ next:
* or official hostname. Also allow match of
* incompletely-specified host in local domain.
*/
- if (__strcasecmp(host, tokval) == 0)
+ if (strcasecmp(host, tokval) == 0)
goto match;
- if ((tmp = __strchr(host, '.')) != NULL &&
- __strcasecmp(tmp, mydomain) == 0 &&
- __strncasecmp(host, tokval, tmp - host) == 0 &&
+ if ((tmp = strchr(host, '.')) != NULL &&
+ strcasecmp(tmp, mydomain) == 0 &&
+ strncasecmp(host, tokval, tmp - host) == 0 &&
tokval[tmp - host] == '\0')
goto match;
continue;
@@ -169,49 +181,49 @@ next:
if (token()) {
if (*aname == 0) {
char *newp;
- newp = malloc((unsigned) __strlen(tokval) + 1);
+ newp = malloc((unsigned) strlen(tokval) + 1);
if (newp == NULL)
{
- __printf(_("out of memory"));
+ printf(_("out of memory"));
goto bad;
}
- *aname = __strcpy(newp, tokval);
+ *aname = strcpy(newp, tokval);
} else {
- if (__strcmp(*aname, tokval))
+ if (strcmp(*aname, tokval))
goto next;
}
}
break;
case PASSWD:
- if (__strcmp(*aname, "anonymous") &&
- __fstat(fileno(cfile), &stb) >= 0 &&
+ if (strcmp(*aname, "anonymous") &&
+ fstat(fileno(cfile), &stb) >= 0 &&
(stb.st_mode & 077) != 0) {
- __printf(_("Error: .netrc file is readable by others."));
- __printf(_("Remove password or make file unreadable by others."));
+ printf(_("Error: .netrc file is readable by others."));
+ printf(_("Remove password or make file unreadable by others."));
goto bad;
}
if (token() && *apass == 0) {
char *newp;
- newp = malloc((unsigned) __strlen(tokval) + 1);
+ newp = malloc((unsigned) strlen(tokval) + 1);
if (newp == NULL)
{
- __printf(_("out of memory"));
+ printf(_("out of memory"));
goto bad;
}
- *apass = __strcpy(newp, tokval);
+ *apass = strcpy(newp, tokval);
}
break;
case ACCOUNT:
#if 0
- if (__fstat(fileno(cfile), &stb) >= 0
+ if (fstat(fileno(cfile), &stb) >= 0
&& (stb.st_mode & 077) != 0) {
- __printf("Error: .netrc file is readable by others.");
- __printf("Remove account or make file unreadable by others.");
+ printf("Error: .netrc file is readable by others.");
+ printf("Remove account or make file unreadable by others.");
goto bad;
}
if (token() && *aacct == 0) {
- *aacct = malloc((unsigned) __strlen(tokval) + 1);
- (void) __strcpy(*aacct, tokval);
+ *aacct = malloc((unsigned) strlen(tokval) + 1);
+ (void) strcpy(*aacct, tokval);
}
#endif
break;
@@ -221,33 +233,33 @@ next:
(void) fclose(cfile);
return (0);
}
- while ((c=__getc_unlocked(cfile)) != EOF && c == ' '
+ while ((c=getc_unlocked(cfile)) != EOF && c == ' '
|| c == '\t');
if (c == EOF || c == '\n') {
- __printf("Missing macdef name argument.\n");
+ printf("Missing macdef name argument.\n");
goto bad;
}
if (macnum == 16) {
- __printf("Limit of 16 macros have already been defined\n");
+ printf("Limit of 16 macros have already been defined\n");
goto bad;
}
tmp = macros[macnum].mac_name;
*tmp++ = c;
- for (i=0; i < 8 && (c=__getc_unlocked(cfile)) != EOF &&
+ for (i=0; i < 8 && (c=getc_unlocked(cfile)) != EOF &&
!isspace(c); ++i) {
*tmp++ = c;
}
if (c == EOF) {
- __printf("Macro definition missing null line terminator.\n");
+ printf("Macro definition missing null line terminator.\n");
goto bad;
}
*tmp = '\0';
if (c != '\n') {
- while ((c=__getc_unlocked(cfile)) != EOF
+ while ((c=getc_unlocked(cfile)) != EOF
&& c != '\n');
}
if (c == EOF) {
- __printf("Macro definition missing null line terminator.\n");
+ printf("Macro definition missing null line terminator.\n");
goto bad;
}
if (macnum == 0) {
@@ -258,8 +270,8 @@ next:
}
tmp = macros[macnum].mac_start;
while (tmp != macbuf + 4096) {
- if ((c=__getc_unlocked(cfile)) == EOF) {
- __printf("Macro definition missing null line terminator.\n");
+ if ((c=getc_unlocked(cfile)) == EOF) {
+ printf("Macro definition missing null line terminator.\n");
goto bad;
}
*tmp = c;
@@ -273,13 +285,13 @@ next:
tmp++;
}
if (tmp == macbuf + 4096) {
- __printf("4K macro buffer exceeded\n");
+ printf("4K macro buffer exceeded\n");
goto bad;
}
#endif
break;
default:
- __printf(_("Unknown .netrc keyword %s"), tokval);
+ printf(_("Unknown .netrc keyword %s"), tokval);
break;
}
goto done;
@@ -291,7 +303,8 @@ bad:
(void) fclose(cfile);
return (-1);
}
-strong_alias(__ruserpass,ruserpass)
+libc_hidden_proto(ruserpass)
+libc_hidden_def(ruserpass)
static int
token()
@@ -302,24 +315,24 @@ token()
if (feof_unlocked(cfile) || ferror_unlocked(cfile))
return (0);
- while ((c = __getc_unlocked(cfile)) != EOF &&
+ while ((c = getc_unlocked(cfile)) != EOF &&
(c == '\n' || c == '\t' || c == ' ' || c == ','))
continue;
if (c == EOF)
return (0);
cp = tokval;
if (c == '"') {
- while ((c = __getc_unlocked(cfile)) != EOF && c != '"') {
+ while ((c = getc_unlocked(cfile)) != EOF && c != '"') {
if (c == '\\')
- c = __getc_unlocked(cfile);
+ c = getc_unlocked(cfile);
*cp++ = c;
}
} else {
*cp++ = c;
- while ((c = __getc_unlocked(cfile)) != EOF
+ while ((c = getc_unlocked(cfile)) != EOF
&& c != '\n' && c != '\t' && c != ' ' && c != ',') {
if (c == '\\')
- c = __getc_unlocked(cfile);
+ c = getc_unlocked(cfile);
*cp++ = c;
}
}
@@ -327,7 +340,7 @@ token()
if (tokval[0] == 0)
return (0);
for (i = 0; i < (int) (sizeof (toktab) / sizeof (toktab[0])); ++i)
- if (!__strcmp(&tokstr[toktab[i].tokstr_off], tokval))
+ if (!strcmp(&tokstr[toktab[i].tokstr_off], tokval))
return toktab[i].tval;
return (ID);
}
diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c
index 168c6e406..76c046ad3 100644
--- a/libc/inet/rpc/svc.c
+++ b/libc/inet/rpc/svc.c
@@ -36,17 +36,6 @@
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#define ffs __ffs
-#define pmap_set __pmap_set
-#define pmap_unset __pmap_unset
-#define _authenticate _authenticate_internal
-#define _rpc_dtablesize _rpc_dtablesize_internal
-/* used by svc_[max_]pollfd */
-#define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal
-#define __rpc_thread_svc_max_pollfd __rpc_thread_svc_max_pollfd_internal
-/* used by svc_fdset */
-#define __rpc_thread_svc_fdset __rpc_thread_svc_fdset_internal
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -58,6 +47,17 @@
#include <rpc/pmap_clnt.h>
#include <sys/poll.h>
+libc_hidden_proto(ffs)
+libc_hidden_proto(pmap_set)
+libc_hidden_proto(pmap_unset)
+libc_hidden_proto(_authenticate)
+libc_hidden_proto(_rpc_dtablesize)
+/* used by svc_[max_]pollfd */
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+/* used by svc_fdset */
+libc_hidden_proto(__rpc_thread_svc_fdset)
+
#ifdef __UCLIBC_HAS_THREADS__
#define xports (*(SVCXPRT ***)&RPC_THREAD_VARIABLE(svc_xports_s))
#else
@@ -86,8 +86,8 @@ static struct svc_callout *svc_head;
/* *************** SVCXPRT related stuff **************** */
/* Activate a transport handle. */
-void attribute_hidden
-__xprt_register (SVCXPRT *xprt)
+void
+xprt_register (SVCXPRT *xprt)
{
register int sock = xprt->xp_sock;
register int i;
@@ -126,11 +126,12 @@ __xprt_register (SVCXPRT *xprt)
POLLRDNORM | POLLRDBAND);
}
}
-strong_alias(__xprt_register,xprt_register)
+libc_hidden_proto(xprt_register)
+libc_hidden_def(xprt_register)
/* De-activate a transport handle. */
-void attribute_hidden
-__xprt_unregister (SVCXPRT *xprt)
+void
+xprt_unregister (SVCXPRT *xprt)
{
register int sock = xprt->xp_sock;
register int i;
@@ -147,7 +148,8 @@ __xprt_unregister (SVCXPRT *xprt)
svc_pollfd[i].fd = -1;
}
}
-strong_alias(__xprt_unregister,xprt_unregister)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_def(xprt_unregister)
/* ********************** CALLOUT list related stuff ************* */
@@ -174,8 +176,8 @@ done:
/* Add a service program to the callout list.
The dispatch routine will be called when a rpc request for this
program number comes in. */
-bool_t attribute_hidden
-__svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
+bool_t
+svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
void (*dispatch) (struct svc_req *, SVCXPRT *),
rpcproc_t protocol)
{
@@ -205,11 +207,12 @@ pmap_it:
return TRUE;
}
-strong_alias(__svc_register,svc_register)
+libc_hidden_proto(svc_register)
+libc_hidden_def(svc_register)
/* Remove a service program from the callout list. */
-void attribute_hidden
-__svc_unregister (rpcprog_t prog, rpcvers_t vers)
+void
+svc_unregister (rpcprog_t prog, rpcvers_t vers)
{
struct svc_callout *prev;
register struct svc_callout *s;
@@ -227,13 +230,14 @@ __svc_unregister (rpcprog_t prog, rpcvers_t vers)
/* now unregister the information with the local binder service */
pmap_unset (prog, vers);
}
-strong_alias(__svc_unregister,svc_unregister)
+libc_hidden_proto(svc_unregister)
+libc_hidden_def(svc_unregister)
/* ******************* REPLY GENERATION ROUTINES ************ */
/* Send a reply to an rpc request */
-bool_t attribute_hidden
-__svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
+bool_t
+svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
caddr_t xdr_location)
{
struct rpc_msg rply;
@@ -246,7 +250,8 @@ __svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
rply.acpted_rply.ar_results.proc = xdr_results;
return SVC_REPLY (xprt, &rply);
}
-strong_alias(__svc_sendreply,svc_sendreply)
+libc_hidden_proto(svc_sendreply)
+libc_hidden_def(svc_sendreply)
/* No procedure error reply */
void
@@ -262,8 +267,8 @@ svcerr_noproc (register SVCXPRT *xprt)
}
/* Can't decode args error reply */
-void attribute_hidden
-__svcerr_decode (register SVCXPRT *xprt)
+void
+svcerr_decode (register SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -273,7 +278,8 @@ __svcerr_decode (register SVCXPRT *xprt)
rply.acpted_rply.ar_stat = GARBAGE_ARGS;
SVC_REPLY (xprt, &rply);
}
-strong_alias(__svcerr_decode,svcerr_decode)
+libc_hidden_proto(svcerr_decode)
+libc_hidden_def(svcerr_decode)
/* Some system error */
void
@@ -289,8 +295,8 @@ svcerr_systemerr (register SVCXPRT *xprt)
}
/* Authentication error reply */
-void attribute_hidden
-__svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
+void
+svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
{
struct rpc_msg rply;
@@ -300,18 +306,19 @@ __svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
rply.rjcted_rply.rj_why = why;
SVC_REPLY (xprt, &rply);
}
-strong_alias(__svcerr_auth,svcerr_auth)
+libc_hidden_proto(svcerr_auth)
+libc_hidden_def(svcerr_auth)
/* Auth too weak error reply */
void
svcerr_weakauth (SVCXPRT *xprt)
{
- __svcerr_auth (xprt, AUTH_TOOWEAK);
+ svcerr_auth (xprt, AUTH_TOOWEAK);
}
/* Program unavailable error reply */
-void attribute_hidden
-__svcerr_noprog (register SVCXPRT *xprt)
+void
+svcerr_noprog (register SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -321,11 +328,12 @@ __svcerr_noprog (register SVCXPRT *xprt)
rply.acpted_rply.ar_stat = PROG_UNAVAIL;
SVC_REPLY (xprt, &rply);
}
-strong_alias(__svcerr_noprog,svcerr_noprog)
+libc_hidden_proto(svcerr_noprog)
+libc_hidden_def(svcerr_noprog)
/* Program version mismatch error reply */
-void attribute_hidden
-__svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
+void
+svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
rpcvers_t high_vers)
{
struct rpc_msg rply;
@@ -338,7 +346,8 @@ __svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
rply.acpted_rply.ar_vers.high = high_vers;
SVC_REPLY (xprt, &rply);
}
-strong_alias(__svcerr_progvers,svcerr_progvers)
+libc_hidden_proto(svcerr_progvers)
+libc_hidden_def(svcerr_progvers)
/* ******************* SERVER INPUT STUFF ******************* */
@@ -358,8 +367,8 @@ strong_alias(__svcerr_progvers,svcerr_progvers)
* is mallocated in kernel land.
*/
-void attribute_hidden
-__svc_getreq_common (const int fd)
+void
+svc_getreq_common (const int fd)
{
enum xprt_stat stat;
struct rpc_msg msg;
@@ -403,7 +412,7 @@ __svc_getreq_common (const int fd)
}
else if ((why = _authenticate (&r, &msg)) != AUTH_OK)
{
- __svcerr_auth (xprt, why);
+ svcerr_auth (xprt, why);
goto call_done;
}
@@ -433,9 +442,9 @@ __svc_getreq_common (const int fd)
/* if we got here, the program or version
is not served ... */
if (prog_found)
- __svcerr_progvers (xprt, low_vers, high_vers);
+ svcerr_progvers (xprt, low_vers, high_vers);
else
- __svcerr_noprog (xprt);
+ svcerr_noprog (xprt);
/* Fall through to ... */
}
call_done:
@@ -447,10 +456,11 @@ __svc_getreq_common (const int fd)
}
while (stat == XPRT_MOREREQS);
}
-strong_alias(__svc_getreq_common,svc_getreq_common)
+libc_hidden_proto(svc_getreq_common)
+libc_hidden_def(svc_getreq_common)
-void attribute_hidden
-__svc_getreqset (fd_set *readfds)
+void
+svc_getreqset (fd_set *readfds)
{
register u_int32_t mask;
register u_int32_t *maskp;
@@ -462,23 +472,25 @@ __svc_getreqset (fd_set *readfds)
maskp = (u_int32_t *) readfds->fds_bits;
for (sock = 0; sock < setsize; sock += 32)
for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
- __svc_getreq_common (sock + bit - 1);
+ svc_getreq_common (sock + bit - 1);
}
-strong_alias(__svc_getreqset,svc_getreqset)
+libc_hidden_proto(svc_getreqset)
+libc_hidden_def(svc_getreqset)
-void attribute_hidden
-__svc_getreq (int rdfds)
+void
+svc_getreq (int rdfds)
{
fd_set readfds;
FD_ZERO (&readfds);
readfds.fds_bits[0] = rdfds;
- __svc_getreqset (&readfds);
+ svc_getreqset (&readfds);
}
-strong_alias(__svc_getreq,svc_getreq)
+libc_hidden_proto(svc_getreq)
+libc_hidden_def(svc_getreq)
-void attribute_hidden
-__svc_getreq_poll (struct pollfd *pfdp, int pollretval)
+void
+svc_getreq_poll (struct pollfd *pfdp, int pollretval)
{
register int i;
register int fds_found;
@@ -493,13 +505,14 @@ __svc_getreq_poll (struct pollfd *pfdp, int pollretval)
++fds_found;
if (p->revents & POLLNVAL)
- __xprt_unregister (xports[p->fd]);
+ xprt_unregister (xports[p->fd]);
else
- __svc_getreq_common (p->fd);
+ svc_getreq_common (p->fd);
}
}
}
-strong_alias(__svc_getreq_poll,svc_getreq_poll)
+libc_hidden_proto(svc_getreq_poll)
+libc_hidden_def(svc_getreq_poll)
#ifdef __UCLIBC_HAS_THREADS__
@@ -508,7 +521,7 @@ void attribute_hidden __rpc_thread_svc_cleanup (void)
struct svc_callout *svcp;
while ((svcp = svc_head) != NULL)
- __svc_unregister (svcp->sc_prog, svcp->sc_vers);
+ svc_unregister (svcp->sc_prog, svcp->sc_vers);
}
#endif /* __UCLIBC_HAS_THREADS__ */
diff --git a/libc/inet/rpc/svc_auth.c b/libc/inet/rpc/svc_auth.c
index 812463396..0e4f85436 100644
--- a/libc/inet/rpc/svc_auth.c
+++ b/libc/inet/rpc/svc_auth.c
@@ -101,8 +101,8 @@ svcauthsw[] =
* There is an assumption that any flavour less than AUTH_NULL is
* invalid.
*/
-enum auth_stat attribute_hidden
-_authenticate_internal (register struct svc_req *rqst, struct rpc_msg *msg)
+enum auth_stat
+_authenticate (register struct svc_req *rqst, struct rpc_msg *msg)
{
register int cred_flavor;
@@ -115,7 +115,8 @@ _authenticate_internal (register struct svc_req *rqst, struct rpc_msg *msg)
return AUTH_REJECTEDCRED;
}
-strong_alias(_authenticate_internal,_authenticate)
+libc_hidden_proto(_authenticate)
+libc_hidden_def(_authenticate)
static enum auth_stat
_svcauth_null (struct svc_req *rqst attribute_unused, struct rpc_msg *msg attribute_unused)
diff --git a/libc/inet/rpc/svc_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c
index 2cd8671c5..220e92b70 100644
--- a/libc/inet/rpc/svc_auth_unix.c
+++ b/libc/inet/rpc/svc_auth_unix.c
@@ -38,9 +38,6 @@
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#define xdrmem_create __xdrmem_create
-#define xdr_authunix_parms __xdr_authunix_parms
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -50,6 +47,11 @@
#include <rpc/rpc.h>
#include <rpc/svc.h>
+libc_hidden_proto(memcpy)
+libc_hidden_proto(printf)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_authunix_parms)
+
/*
* Unix longhand authenticator
*/
@@ -88,7 +90,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
stat = AUTH_BADCRED;
goto done;
}
- __memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len);
+ memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len);
aup->aup_machname[str_len] = 0;
str_len = RNDUP (str_len);
buf = (int32_t *) ((char *) buf + str_len);
@@ -111,7 +113,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
*/
if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len)
{
- (void) __printf ("bad auth_len gid %d str %d auth %d\n",
+ (void) printf ("bad auth_len gid %d str %d auth %d\n",
gid_len, str_len, auth_len);
stat = AUTH_BADCRED;
goto done;
diff --git a/libc/inet/rpc/svc_raw.c b/libc/inet/rpc/svc_raw.c
index 986350882..0cdbbb89a 100644
--- a/libc/inet/rpc/svc_raw.c
+++ b/libc/inet/rpc/svc_raw.c
@@ -40,15 +40,15 @@ static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#define xdrmem_create __xdrmem_create
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-
#define __FORCE_GLIBC
#include <features.h>
#include "rpc_private.h"
#include <rpc/svc.h>
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+
/*
* This is the "network" that we will be moving data over
*/
diff --git a/libc/inet/rpc/svc_run.c b/libc/inet/rpc/svc_run.c
index d2c06b895..5ec4715bd 100644
--- a/libc/inet/rpc/svc_run.c
+++ b/libc/inet/rpc/svc_run.c
@@ -31,13 +31,6 @@
* Wait for input, call server program.
*/
-#define svc_getreq_poll __svc_getreq_poll
-#define poll __poll
-
-/* used by svc_[max_]pollfd */
-#define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal
-#define __rpc_thread_svc_max_pollfd __rpc_thread_svc_max_pollfd_internal
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -47,6 +40,13 @@
#include <sys/poll.h>
#include <rpc/rpc.h>
+libc_hidden_proto(perror)
+libc_hidden_proto(svc_getreq_poll)
+libc_hidden_proto(poll)
+/* used by svc_[max_]pollfd */
+libc_hidden_proto(__rpc_thread_svc_pollfd)
+libc_hidden_proto(__rpc_thread_svc_max_pollfd)
+
/* This function can be used as a signal handler to terminate the
server loop. */
void
@@ -83,7 +83,7 @@ svc_run (void)
free (my_pollfd);
if (errno == EINTR)
continue;
- __perror (_("svc_run: - poll failed"));
+ perror (_("svc_run: - poll failed"));
return;
case 0:
free (my_pollfd);
diff --git a/libc/inet/rpc/svc_simple.c b/libc/inet/rpc/svc_simple.c
index 825235450..7657bb7f9 100644
--- a/libc/inet/rpc/svc_simple.c
+++ b/libc/inet/rpc/svc_simple.c
@@ -38,14 +38,6 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#define svc_sendreply __svc_sendreply
-#define svc_register __svc_register
-#define svcerr_decode __svcerr_decode
-#define svcudp_create __svcudp_create
-#define pmap_unset __pmap_unset
-#define asprintf __asprintf
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -64,6 +56,18 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
# define fputs(s, f) _IO_fputs (s, f)
#endif
+libc_hidden_proto(strdup)
+libc_hidden_proto(memset)
+libc_hidden_proto(asprintf)
+libc_hidden_proto(fputs)
+libc_hidden_proto(write)
+libc_hidden_proto(exit)
+libc_hidden_proto(svc_sendreply)
+libc_hidden_proto(svc_register)
+libc_hidden_proto(svcerr_decode)
+libc_hidden_proto(svcudp_create)
+libc_hidden_proto(pmap_unset)
+
struct proglst_
{
char *(*p_progname) (char *);
@@ -105,7 +109,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
transp = svcudp_create (RPC_ANYSOCK);
if (transp == NULL)
{
- buf = __strdup (_("couldn't create an rpc server\n"));
+ buf = strdup (_("couldn't create an rpc server\n"));
goto err_out;
}
}
@@ -120,7 +124,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
pl = (struct proglst_ *) malloc (sizeof (struct proglst_));
if (pl == NULL)
{
- buf = __strdup (_("registerrpc: out of memory\n"));
+ buf = strdup (_("registerrpc: out of memory\n"));
goto err_out;
}
pl->p_progname = progname;
@@ -159,8 +163,8 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
{
if (svc_sendreply (transp_l, (xdrproc_t)xdr_void, (char *) NULL) == FALSE)
{
- __write (STDERR_FILENO, "xxx\n", 4);
- __exit (1);
+ write (STDERR_FILENO, "xxx\n", 4);
+ exit (1);
}
return;
}
@@ -170,7 +174,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
if (pl->p_prognum == prog && pl->p_procnum == proc)
{
/* decode arguments into a CLEAN buffer */
- __memset (xdrbuf, 0, sizeof (xdrbuf)); /* required ! */
+ memset (xdrbuf, 0, sizeof (xdrbuf)); /* required ! */
if (!svc_getargs (transp_l, pl->p_inproc, xdrbuf))
{
svcerr_decode (transp_l);
@@ -185,7 +189,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
(void) asprintf (&buf,
_("trouble replying to prog %d\n"),
pl->p_prognum);
- __exit (1);
+ exit (1);
}
/* free the decoded arguments */
(void) svc_freeargs (transp_l, pl->p_inproc, xdrbuf);
@@ -199,5 +203,5 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
#endif
fputs (buf, stderr);
free (buf);
- __exit (1);
+ exit (1);
}
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index 4a2556159..13a2469dd 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -41,22 +41,6 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
* and a record/tcp stream.
*/
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdrrec_eof __xdrrec_eof
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define getsockname __getsockname
-#define bind __bind
-#define bindresvport __bindresvport
-#define poll __poll
-#define accept __accept
-#define listen __listen
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -76,6 +60,31 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
# define fputs(s, f) _IO_fputs (s, f)
#endif
+libc_hidden_proto(memset)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+libc_hidden_proto(perror)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(bind)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(fputs)
+libc_hidden_proto(fclose)
+libc_hidden_proto(abort)
+
/*
* Ops vector for TCP/IP based rpc service handle
*/
@@ -170,14 +179,14 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
if (sock == RPC_ANYSOCK)
{
- if ((sock = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
- __perror (_("svc_tcp.c - tcp socket creation problem"));
+ perror (_("svc_tcp.c - tcp socket creation problem"));
return (SVCXPRT *) NULL;
}
madesock = TRUE;
}
- __memset ((char *) &addr, 0, sizeof (addr));
+ memset ((char *) &addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
if (bindresvport (sock, &addr))
{
@@ -187,9 +196,9 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
if ((getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
(listen (sock, 2) != 0))
{
- __perror (_("svc_tcp.c - cannot getsockname or listen"));
+ perror (_("svc_tcp.c - cannot getsockname or listen"));
if (madesock)
- (void) __close (sock);
+ (void) close (sock);
return (SVCXPRT *) NULL;
}
r = (struct tcp_rendezvous *) mem_alloc (sizeof (*r));
@@ -285,7 +294,7 @@ again:
* make a new transporter (re-uses xprt)
*/
xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
- __memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
+ memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
xprt->xp_addrlen = len;
return FALSE; /* there is never an rpc msg to be processed */
}
@@ -302,7 +311,7 @@ svctcp_destroy (SVCXPRT *xprt)
struct tcp_conn *cd = (struct tcp_conn *) xprt->xp_p1;
xprt_unregister (xprt);
- (void) __close (xprt->xp_sock);
+ (void) close (xprt->xp_sock);
if (xprt->xp_port != 0)
{
/* a rendezvouser socket */
@@ -352,7 +361,7 @@ readtcp (char *xprtptr, char *buf, int len)
}
while ((pollfd.revents & POLLIN) == 0);
- if ((len = __read (sock, buf, len)) > 0)
+ if ((len = read (sock, buf, len)) > 0)
return len;
fatal_err:
@@ -372,7 +381,7 @@ writetcp (char *xprtptr, char * buf, int len)
for (cnt = len; cnt > 0; cnt -= i, buf += i)
{
- if ((i = __write (xprt->xp_sock, buf, cnt)) < 0)
+ if ((i = write (xprt->xp_sock, buf, cnt)) < 0)
{
((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
return -1;
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index 82f279814..07c7661b5 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -39,21 +39,6 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define xdrmem_create __xdrmem_create
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define getsockname __getsockname
-#define setsockopt __setsockopt
-#define bind __bind
-#define bindresvport __bindresvport
-#define recvfrom __recvfrom
-#define sendto __sendto
-#define recvmsg __recvmsg
-#define sendmsg __sendmsg
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -73,8 +58,31 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
# include <wchar.h>
# include <libio/iolibio.h>
# define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(memcmp)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(perror)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(bind)
+libc_hidden_proto(bindresvport)
+libc_hidden_proto(recvfrom)
+libc_hidden_proto(sendto)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_proto(fputs)
+libc_hidden_proto(fprintf)
+
#define rpc_buffer(xprt) ((xprt)->xp_p1)
#ifndef MAX
#define MAX(a, b) ((a > b) ? a : b)
@@ -127,8 +135,8 @@ struct svcudp_data
* see (svc.h, xprt_register).
* The routines returns NULL if a problem occurred.
*/
-SVCXPRT attribute_hidden *
-__svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
+SVCXPRT *
+svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
{
bool_t madesock = FALSE;
SVCXPRT *xprt;
@@ -140,14 +148,14 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
if (sock == RPC_ANYSOCK)
{
- if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
{
- __perror (_("svcudp_create: socket creation problem"));
+ perror (_("svcudp_create: socket creation problem"));
return (SVCXPRT *) NULL;
}
madesock = TRUE;
}
- __memset ((char *) &addr, 0, sizeof (addr));
+ memset ((char *) &addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
if (bindresvport (sock, &addr))
{
@@ -156,9 +164,9 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
}
if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
{
- __perror (_("svcudp_create - cannot getsockname"));
+ perror (_("svcudp_create - cannot getsockname"));
if (madesock)
- (void) __close (sock);
+ (void) close (sock);
return (SVCXPRT *) NULL;
}
xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT));
@@ -168,7 +176,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s", _("svcudp_create: out of memory\n"));
+ (void) fwprintf (stderr, L"%s", _("svcudp_create: out of memory\n"));
else
#endif
(void) fputs (_("svcudp_create: out of memory\n"), stderr);
@@ -194,7 +202,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
{
# ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s",
+ (void) fwprintf (stderr, L"%s",
_("svcudp_create: xp_pad is too small for IP_PKTINFO\n"));
else
# endif
@@ -211,20 +219,22 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
#endif
/* Clear the padding. */
pad = 0;
- __memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad));
+ memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad));
xprt_register (xprt);
return xprt;
}
-strong_alias(__svcudp_bufcreate,svcudp_bufcreate)
+libc_hidden_proto(svcudp_bufcreate)
+libc_hidden_def(svcudp_bufcreate)
-SVCXPRT attribute_hidden *
-__svcudp_create (int sock)
+SVCXPRT *
+svcudp_create (int sock)
{
- return __svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
+ return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
}
-strong_alias(__svcudp_create,svcudp_create)
+libc_hidden_proto(svcudp_create)
+libc_hidden_def(svcudp_create)
static enum xprt_stat
svcudp_stat (xprt)
@@ -387,7 +397,7 @@ svcudp_destroy (xprt)
struct svcudp_data *su = su_data (xprt);
xprt_unregister (xprt);
- (void) __close (xprt->xp_sock);
+ (void) close (xprt->xp_sock);
XDR_DESTROY (&(su->su_xdrs));
mem_free (rpc_buffer (xprt), su->su_iosz);
mem_free ((caddr_t) su, sizeof (struct svcudp_data));
@@ -420,7 +430,7 @@ svcudp_destroy (xprt)
(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
#define BZERO(addr, type, size) \
- __memset((char *) addr, 0, sizeof(type) * (int) (size))
+ memset((char *) addr, 0, sizeof(type) * (int) (size))
/*
* An entry in the cache
@@ -598,7 +608,7 @@ cache_get (xprt, msg, replyp, replylenp)
struct svcudp_data *su = su_data (xprt);
struct udp_cache *uc = (struct udp_cache *) su->su_cache;
-#define EQADDR(a1, a2) (__memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
+#define EQADDR(a1, a2) (memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
loc = CACHE_LOC (xprt, su->su_xid);
for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next)
@@ -621,6 +631,6 @@ cache_get (xprt, msg, replyp, replylenp)
uc->uc_proc = msg->rm_call.cb_proc;
uc->uc_vers = msg->rm_call.cb_vers;
uc->uc_prog = msg->rm_call.cb_prog;
- __memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr));
+ memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr));
return 0;
}
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index d71485f0a..02e327a8e 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -37,26 +37,6 @@
* and a record/unix stream.
*/
-#define xdrrec_create __xdrrec_create
-#define xdrrec_endofrecord __xdrrec_endofrecord
-#define xdrrec_skiprecord __xdrrec_skiprecord
-#define xdrrec_eof __xdrrec_eof
-#define xdr_callmsg __xdr_callmsg
-#define xdr_replymsg __xdr_replymsg
-#define xprt_register __xprt_register
-#define xprt_unregister __xprt_unregister
-#define getegid __getegid
-#define geteuid __geteuid
-#define getsockname __getsockname
-#define setsockopt __setsockopt
-#define bind __bind
-#define recvmsg __recvmsg
-#define sendmsg __sendmsg
-#define poll __poll
-#define accept __accept
-#define listen __listen
-#define fputs __fputs
-
#define __FORCE_GLIBC
#include <features.h>
@@ -75,6 +55,34 @@
# include <wchar.h>
#endif
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(strlen)
+libc_hidden_proto(socket)
+libc_hidden_proto(close)
+libc_hidden_proto(perror)
+libc_hidden_proto(getpid)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_proto(xdr_callmsg)
+libc_hidden_proto(xdr_replymsg)
+libc_hidden_proto(xprt_register)
+libc_hidden_proto(xprt_unregister)
+libc_hidden_proto(getegid)
+libc_hidden_proto(geteuid)
+libc_hidden_proto(getsockname)
+libc_hidden_proto(setsockopt)
+libc_hidden_proto(bind)
+libc_hidden_proto(recvmsg)
+libc_hidden_proto(sendmsg)
+libc_hidden_proto(poll)
+libc_hidden_proto(accept)
+libc_hidden_proto(listen)
+libc_hidden_proto(fputs)
+libc_hidden_proto(abort)
+
/*
* Ops vector for AF_UNIX based rpc service handle
*/
@@ -167,17 +175,17 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
if (sock == RPC_ANYSOCK)
{
- if ((sock = __socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
+ if ((sock = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
- __perror (_("svc_unix.c - AF_UNIX socket creation problem"));
+ perror (_("svc_unix.c - AF_UNIX socket creation problem"));
return (SVCXPRT *) NULL;
}
madesock = TRUE;
}
- __memset (&addr, '\0', sizeof (addr));
+ memset (&addr, '\0', sizeof (addr));
addr.sun_family = AF_UNIX;
- len = __strlen (path) + 1;
- __memcpy (addr.sun_path, path, len);
+ len = strlen (path) + 1;
+ memcpy (addr.sun_path, path, len);
len += sizeof (addr.sun_family);
bind (sock, (struct sockaddr *) &addr, len);
@@ -185,9 +193,9 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0
|| listen (sock, 2) != 0)
{
- __perror (_("svc_unix.c - cannot getsockname or listen"));
+ perror (_("svc_unix.c - cannot getsockname or listen"));
if (madesock)
- __close (sock);
+ close (sock);
return (SVCXPRT *) NULL;
}
@@ -284,10 +292,10 @@ again:
/*
* make a new transporter (re-uses xprt)
*/
- __memset (&in_addr, '\0', sizeof (in_addr));
+ memset (&in_addr, '\0', sizeof (in_addr));
in_addr.sin_family = AF_UNIX;
xprt = makefd_xprt (sock, r->sendsize, r->recvsize);
- __memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr));
+ memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr));
xprt->xp_addrlen = len;
return FALSE; /* there is never an rpc msg to be processed */
}
@@ -304,7 +312,7 @@ svcunix_destroy (SVCXPRT *xprt)
struct unix_conn *cd = (struct unix_conn *) xprt->xp_p1;
xprt_unregister (xprt);
- __close (xprt->xp_sock);
+ close (xprt->xp_sock);
if (xprt->xp_port != 0)
{
/* a rendezvouser socket */
@@ -392,11 +400,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/xdr.c b/libc/inet/rpc/xdr.c
index 1474c1e08..c83416343 100644
--- a/libc/inet/rpc/xdr.c
+++ b/libc/inet/rpc/xdr.c
@@ -41,8 +41,6 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
* xdr.
*/
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -56,8 +54,12 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
#ifdef USE_IN_LIBIO
# include <wchar.h>
+libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(strlen)
+libc_hidden_proto(fputs)
+
/*
* constants specific to the xdr "protocol"
*/
@@ -97,8 +99,8 @@ xdr_void (void)
* The definition of xdr_long() is kept for backward
* compatibility. Instead xdr_int() should be used.
*/
-bool_t attribute_hidden
-__xdr_long (XDR *xdrs, long *lp)
+bool_t
+xdr_long (XDR *xdrs, long *lp)
{
if (xdrs->x_op == XDR_ENCODE
@@ -114,13 +116,14 @@ __xdr_long (XDR *xdrs, long *lp)
return FALSE;
}
-strong_alias(__xdr_long,xdr_long)
+libc_hidden_proto(xdr_long)
+libc_hidden_def(xdr_long)
/*
* XDR short integers
*/
-bool_t attribute_hidden
-__xdr_short (XDR *xdrs, short *sp)
+bool_t
+xdr_short (XDR *xdrs, short *sp)
{
long l;
@@ -143,13 +146,14 @@ __xdr_short (XDR *xdrs, short *sp)
}
return FALSE;
}
-strong_alias(__xdr_short,xdr_short)
+libc_hidden_proto(xdr_short)
+libc_hidden_def(xdr_short)
/*
* XDR integers
*/
-bool_t attribute_hidden
-__xdr_int (XDR *xdrs, int *ip)
+bool_t
+xdr_int (XDR *xdrs, int *ip)
{
#if INT_MAX < LONG_MAX
@@ -172,22 +176,23 @@ __xdr_int (XDR *xdrs, int *ip)
}
return FALSE;
#elif INT_MAX == LONG_MAX
- return __xdr_long (xdrs, (long *) ip);
+ return xdr_long (xdrs, (long *) ip);
#elif INT_MAX == SHRT_MAX
- return __xdr_short (xdrs, (short *) ip);
+ return xdr_short (xdrs, (short *) ip);
#else
#error unexpected integer sizes in xdr_int()
#endif
}
-strong_alias(__xdr_int,xdr_int)
+libc_hidden_proto(xdr_int)
+libc_hidden_def(xdr_int)
/*
* XDR unsigned long integers
* The definition of xdr_u_long() is kept for backward
* compatibility. Instead xdr_u_int() should be used.
*/
-bool_t attribute_hidden
-__xdr_u_long (XDR *xdrs, u_long *ulp)
+bool_t
+xdr_u_long (XDR *xdrs, u_long *ulp)
{
switch (xdrs->x_op)
{
@@ -214,13 +219,14 @@ __xdr_u_long (XDR *xdrs, u_long *ulp)
}
return FALSE;
}
-strong_alias(__xdr_u_long,xdr_u_long)
+libc_hidden_proto(xdr_u_long)
+libc_hidden_def(xdr_u_long)
/*
* XDR unsigned integers
*/
-bool_t attribute_hidden
-__xdr_u_int (XDR *xdrs, u_int *up)
+bool_t
+xdr_u_int (XDR *xdrs, u_int *up)
{
#if UINT_MAX < ULONG_MAX
u_long l;
@@ -242,21 +248,22 @@ __xdr_u_int (XDR *xdrs, u_int *up)
}
return FALSE;
#elif UINT_MAX == ULONG_MAX
- return __xdr_u_long (xdrs, (u_long *) up);
+ return xdr_u_long (xdrs, (u_long *) up);
#elif UINT_MAX == USHRT_MAX
- return __xdr_short (xdrs, (short *) up);
+ return xdr_short (xdrs, (short *) up);
#else
#error unexpected integer sizes in xdr_u_int()
#endif
}
-strong_alias(__xdr_u_int,xdr_u_int)
+libc_hidden_proto(xdr_u_int)
+libc_hidden_def(xdr_u_int)
/*
* XDR hyper integers
* same as xdr_u_hyper - open coded to save a proc call!
*/
-bool_t attribute_hidden
-__xdr_hyper (XDR *xdrs, quad_t *llp)
+bool_t
+xdr_hyper (XDR *xdrs, quad_t *llp)
{
long t1;
unsigned long int t2;
@@ -282,15 +289,16 @@ __xdr_hyper (XDR *xdrs, quad_t *llp)
return FALSE;
}
-strong_alias(__xdr_hyper,xdr_hyper)
+libc_hidden_proto(xdr_hyper)
+libc_hidden_def(xdr_hyper)
/*
* XDR hyper integers
* same as xdr_hyper - open coded to save a proc call!
*/
-bool_t attribute_hidden
-__xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
+bool_t
+xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
{
unsigned long t1;
unsigned long t2;
@@ -316,18 +324,19 @@ __xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
return FALSE;
}
-strong_alias(__xdr_u_hyper,xdr_u_hyper)
+libc_hidden_proto(xdr_u_hyper)
+libc_hidden_def(xdr_u_hyper)
bool_t
xdr_longlong_t (XDR *xdrs, quad_t *llp)
{
- return __xdr_hyper (xdrs, llp);
+ return xdr_hyper (xdrs, llp);
}
bool_t
xdr_u_longlong_t (XDR *xdrs, u_quad_t *ullp)
{
- return __xdr_u_hyper (xdrs, ullp);
+ return xdr_u_hyper (xdrs, ullp);
}
/*
@@ -368,7 +377,7 @@ xdr_char (XDR *xdrs, char *cp)
int i;
i = (*cp);
- if (!__xdr_int (xdrs, &i))
+ if (!xdr_int (xdrs, &i))
{
return FALSE;
}
@@ -385,7 +394,7 @@ xdr_u_char (XDR *xdrs, u_char *cp)
u_int u;
u = (*cp);
- if (!__xdr_u_int (xdrs, &u))
+ if (!xdr_u_int (xdrs, &u))
{
return FALSE;
}
@@ -396,8 +405,8 @@ xdr_u_char (XDR *xdrs, u_char *cp)
/*
* XDR booleans
*/
-bool_t attribute_hidden
-__xdr_bool (XDR *xdrs, bool_t *bp)
+bool_t
+xdr_bool (XDR *xdrs, bool_t *bp)
{
long lb;
@@ -420,13 +429,14 @@ __xdr_bool (XDR *xdrs, bool_t *bp)
}
return FALSE;
}
-strong_alias(__xdr_bool,xdr_bool)
+libc_hidden_proto(xdr_bool)
+libc_hidden_def(xdr_bool)
/*
* XDR enumerations
*/
-bool_t attribute_hidden
-__xdr_enum (XDR *xdrs, enum_t *ep)
+bool_t
+xdr_enum (XDR *xdrs, enum_t *ep)
{
enum sizecheck
{
@@ -459,27 +469,28 @@ __xdr_enum (XDR *xdrs, enum_t *ep)
}
return FALSE;
#else
- return __xdr_long (xdrs, (long *) ep);
+ return xdr_long (xdrs, (long *) ep);
#endif
}
else if (sizeof (enum sizecheck) == sizeof (short))
{
- return __xdr_short (xdrs, (short *) ep);
+ return xdr_short (xdrs, (short *) ep);
}
else
{
return FALSE;
}
}
-strong_alias(__xdr_enum,xdr_enum)
+libc_hidden_proto(xdr_enum)
+libc_hidden_def(xdr_enum)
/*
* XDR opaque data
* Allows the specification of a fixed size sequence of opaque bytes.
* cp points to the opaque object and cnt gives the byte length.
*/
-bool_t attribute_hidden
-__xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
+bool_t
+xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
{
u_int rndup;
static char crud[BYTES_PER_XDR_UNIT];
@@ -522,15 +533,16 @@ __xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
}
return FALSE;
}
-strong_alias(__xdr_opaque,xdr_opaque)
+libc_hidden_proto(xdr_opaque)
+libc_hidden_def(xdr_opaque)
/*
* XDR counted bytes
* *cpp is a pointer to the bytes, *sizep is the count.
* If *cpp is NULL maxsize bytes are allocated
*/
-bool_t attribute_hidden
-__xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
+bool_t
+xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int nodesize;
@@ -538,7 +550,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
/*
* first deal with the length since xdr bytes are counted
*/
- if (!__xdr_u_int (xdrs, sizep))
+ if (!xdr_u_int (xdrs, sizep))
{
return FALSE;
}
@@ -566,7 +578,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s", _("xdr_bytes: out of memory\n"));
+ (void) fwprintf (stderr, L"%s", _("xdr_bytes: out of memory\n"));
else
#endif
(void) fputs (_("xdr_bytes: out of memory\n"), stderr);
@@ -575,7 +587,7 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
/* fall into ... */
case XDR_ENCODE:
- return __xdr_opaque (xdrs, sp, nodesize);
+ return xdr_opaque (xdrs, sp, nodesize);
case XDR_FREE:
if (sp != NULL)
@@ -587,7 +599,8 @@ __xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
}
return FALSE;
}
-strong_alias(__xdr_bytes,xdr_bytes)
+libc_hidden_proto(xdr_bytes)
+libc_hidden_def(xdr_bytes)
/*
* Implemented here due to commonality of the object.
@@ -598,7 +611,7 @@ xdr_netobj (xdrs, np)
struct netobj *np;
{
- return __xdr_bytes (xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ);
+ return xdr_bytes (xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ);
}
/*
@@ -612,15 +625,15 @@ xdr_netobj (xdrs, np)
* routine may be called.
* If there is no specific or default routine an error is returned.
*/
-bool_t attribute_hidden
-__xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
+bool_t
+xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
{
enum_t dscm;
/*
* we deal with the discriminator; it's an enum
*/
- if (!__xdr_enum (xdrs, dscmp))
+ if (!xdr_enum (xdrs, dscmp))
{
return FALSE;
}
@@ -642,7 +655,8 @@ __xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choi
return ((dfault == NULL_xdrproc_t) ? FALSE :
(*dfault) (xdrs, unp, LASTUNSIGNED));
}
-strong_alias(__xdr_union,xdr_union)
+libc_hidden_proto(xdr_union)
+libc_hidden_def(xdr_union)
/*
* Non-portable xdr primitives.
@@ -658,8 +672,8 @@ strong_alias(__xdr_union,xdr_union)
* storage is allocated. The last parameter is the max allowed length
* of the string as specified by a protocol.
*/
-bool_t attribute_hidden
-__xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
+bool_t
+xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int size;
@@ -679,12 +693,12 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
case XDR_ENCODE:
if (sp == NULL)
return FALSE;
- size = __strlen (sp);
+ size = strlen (sp);
break;
case XDR_DECODE:
break;
}
- if (!__xdr_u_int (xdrs, &size))
+ if (!xdr_u_int (xdrs, &size))
{
return FALSE;
}
@@ -710,7 +724,7 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s",
+ (void) fwprintf (stderr, L"%s",
_("xdr_string: out of memory\n"));
else
#endif
@@ -721,7 +735,7 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
/* fall into ... */
case XDR_ENCODE:
- return __xdr_opaque (xdrs, sp, size);
+ return xdr_opaque (xdrs, sp, size);
case XDR_FREE:
mem_free (sp, nodesize);
@@ -730,7 +744,8 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize)
}
return FALSE;
}
-strong_alias(__xdr_string,xdr_string)
+libc_hidden_proto(xdr_string)
+libc_hidden_def(xdr_string)
/*
* Wrapper for xdr_string that can be called directly from
@@ -741,7 +756,7 @@ xdr_wrapstring (xdrs, cpp)
XDR *xdrs;
char **cpp;
{
- if (__xdr_string (xdrs, cpp, LASTUNSIGNED))
+ if (xdr_string (xdrs, cpp, LASTUNSIGNED))
{
return TRUE;
}
diff --git a/libc/inet/rpc/xdr_array.c b/libc/inet/rpc/xdr_array.c
index 5432a5d01..cebf44586 100644
--- a/libc/inet/rpc/xdr_array.c
+++ b/libc/inet/rpc/xdr_array.c
@@ -40,9 +40,6 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
* arrays. See xdr.h for more info on the interface to xdr.
*/
-#define xdr_u_int __xdr_u_int
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -55,8 +52,13 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
#ifdef USE_IN_LIBIO
# include <wchar.h>
+libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(memset)
+libc_hidden_proto(fputs)
+libc_hidden_proto(xdr_u_int)
+
#define LASTUNSIGNED ((u_int)0-1)
@@ -67,8 +69,8 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
* elsize is the size (in bytes) of each element, and elproc is the
* xdr procedure to call to handle each element of the array.
*/
-bool_t attribute_hidden
-__xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
+bool_t
+xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
{
u_int i;
caddr_t target = *addrp;
@@ -107,14 +109,14 @@ __xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsiz
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s",
+ (void) fwprintf (stderr, L"%s",
_("xdr_array: out of memory\n"));
else
#endif
(void) fputs (_("xdr_array: out of memory\n"), stderr);
return FALSE;
}
- __memset (target, 0, nodesize);
+ memset (target, 0, nodesize);
break;
case XDR_FREE:
@@ -142,7 +144,8 @@ __xdr_array (XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsiz
}
return stat;
}
-strong_alias(__xdr_array,xdr_array)
+libc_hidden_proto(xdr_array)
+libc_hidden_def(xdr_array)
/*
* xdr_vector():
diff --git a/libc/inet/rpc/xdr_mem.c b/libc/inet/rpc/xdr_mem.c
index 4b6a4817e..c2af1393c 100644
--- a/libc/inet/rpc/xdr_mem.c
+++ b/libc/inet/rpc/xdr_mem.c
@@ -46,6 +46,8 @@
#include <string.h>
#include <rpc/rpc.h>
+libc_hidden_proto(memcpy)
+
static bool_t xdrmem_getlong (XDR *, long *);
static bool_t xdrmem_putlong (XDR *, const long *);
static bool_t xdrmem_getbytes (XDR *, caddr_t, u_int);
@@ -75,8 +77,8 @@ static const struct xdr_ops xdrmem_ops =
* The procedure xdrmem_create initializes a stream descriptor for a
* memory buffer.
*/
-void attribute_hidden
-__xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
+void
+xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
{
xdrs->x_op = op;
/* We have to add the const since the `struct xdr_ops' in `struct XDR'
@@ -85,7 +87,8 @@ __xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
xdrs->x_private = xdrs->x_base = addr;
xdrs->x_handy = size;
}
-strong_alias(__xdrmem_create,xdrmem_create)
+libc_hidden_proto(xdrmem_create)
+libc_hidden_def(xdrmem_create)
/*
* Nothing needs to be done for the memory case. The argument is clearly
@@ -138,7 +141,7 @@ xdrmem_getbytes (XDR *xdrs, caddr_t addr, u_int len)
{
if ((xdrs->x_handy -= len) < 0)
return FALSE;
- __memcpy (addr, xdrs->x_private, len);
+ memcpy (addr, xdrs->x_private, len);
xdrs->x_private += len;
return TRUE;
}
@@ -152,7 +155,7 @@ xdrmem_putbytes (XDR *xdrs, const char *addr, u_int len)
{
if ((xdrs->x_handy -= len) < 0)
return FALSE;
- __memcpy (xdrs->x_private, addr, len);
+ memcpy (xdrs->x_private, addr, len);
xdrs->x_private += len;
return TRUE;
}
diff --git a/libc/inet/rpc/xdr_rec.c b/libc/inet/rpc/xdr_rec.c
index 15381a6cc..429503cdc 100644
--- a/libc/inet/rpc/xdr_rec.c
+++ b/libc/inet/rpc/xdr_rec.c
@@ -44,8 +44,6 @@
* The other 31 bits encode the byte length of the fragment.
*/
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -60,8 +58,13 @@
# include <wchar.h>
# include <libio/iolibio.h>
# define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(memcpy)
+libc_hidden_proto(fputs)
+libc_hidden_proto(lseek)
+
static bool_t xdrrec_getlong (XDR *, long *);
static bool_t xdrrec_putlong (XDR *, const long *);
static bool_t xdrrec_getbytes (XDR *, caddr_t, u_int);
@@ -144,8 +147,8 @@ static bool_t get_input_bytes (RECSTREAM *, caddr_t, int) internal_function;
* write respectively. They are like the system
* calls expect that they take an opaque handle rather than an fd.
*/
-void attribute_hidden
-__xdrrec_create (XDR *xdrs, u_int sendsize,
+void
+xdrrec_create (XDR *xdrs, u_int sendsize,
u_int recvsize, caddr_t tcp_handle,
int (*readit) (char *, char *, int),
int (*writeit) (char *, char *, int))
@@ -162,7 +165,7 @@ __xdrrec_create (XDR *xdrs, u_int sendsize,
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s", _("xdrrec_create: out of memory\n"));
+ (void) fwprintf (stderr, L"%s", _("xdrrec_create: out of memory\n"));
else
#endif
(void) fputs (_("xdrrec_create: out of memory\n"), stderr);
@@ -206,7 +209,8 @@ __xdrrec_create (XDR *xdrs, u_int sendsize,
rstrm->fbtbc = 0;
rstrm->last_frag = TRUE;
}
-strong_alias(__xdrrec_create,xdrrec_create)
+libc_hidden_proto(xdrrec_create)
+libc_hidden_def(xdrrec_create)
/*
@@ -299,7 +303,7 @@ xdrrec_putbytes (XDR *xdrs, const char *addr, u_int len)
{
current = rstrm->out_boundry - rstrm->out_finger;
current = (len < current) ? len : current;
- __memcpy (rstrm->out_finger, addr, current);
+ memcpy (rstrm->out_finger, addr, current);
rstrm->out_finger += current;
addr += current;
len -= current;
@@ -319,7 +323,7 @@ xdrrec_getpos (const XDR *xdrs)
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
long pos;
- pos = __lseek ((int) (long) rstrm->tcp_handle, (long) 0, 1);
+ pos = lseek ((int) (long) rstrm->tcp_handle, (long) 0, 1);
if (pos != -1)
switch (xdrs->x_op)
{
@@ -478,8 +482,8 @@ xdrrec_putint32 (XDR *xdrs, const int32_t *ip)
* Before reading (deserializing from the stream, one should always call
* this procedure to guarantee proper record alignment.
*/
-bool_t attribute_hidden
-__xdrrec_skiprecord (XDR *xdrs)
+bool_t
+xdrrec_skiprecord (XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
@@ -494,15 +498,16 @@ __xdrrec_skiprecord (XDR *xdrs)
rstrm->last_frag = FALSE;
return TRUE;
}
-strong_alias(__xdrrec_skiprecord,xdrrec_skiprecord)
+libc_hidden_proto(xdrrec_skiprecord)
+libc_hidden_def(xdrrec_skiprecord)
/*
* Lookahead function.
* Returns TRUE iff there is no more input in the buffer
* after consuming the rest of the current record.
*/
-bool_t attribute_hidden
-__xdrrec_eof (XDR *xdrs)
+bool_t
+xdrrec_eof (XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
@@ -518,7 +523,8 @@ __xdrrec_eof (XDR *xdrs)
return TRUE;
return FALSE;
}
-strong_alias(__xdrrec_eof,xdrrec_eof)
+libc_hidden_proto(xdrrec_eof)
+libc_hidden_def(xdrrec_eof)
/*
* The client must tell the package when an end-of-record has occurred.
@@ -526,8 +532,8 @@ strong_alias(__xdrrec_eof,xdrrec_eof)
* (output) tcp stream. (This lets the package support batched or
* pipelined procedure calls.) TRUE => immediate flush to tcp connection.
*/
-bool_t attribute_hidden
-__xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
+bool_t
+xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
u_long len; /* fragment length */
@@ -545,7 +551,8 @@ __xdrrec_endofrecord (XDR *xdrs, bool_t sendnow)
rstrm->out_finger += BYTES_PER_XDR_UNIT;
return TRUE;
}
-strong_alias(__xdrrec_endofrecord,xdrrec_endofrecord)
+libc_hidden_proto(xdrrec_endofrecord)
+libc_hidden_def(xdrrec_endofrecord)
/*
* Internal useful routines
@@ -603,7 +610,7 @@ get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len)
continue;
}
current = (len < current) ? len : current;
- __memcpy (addr, rstrm->in_finger, current);
+ memcpy (addr, rstrm->in_finger, current);
rstrm->in_finger += current;
addr += current;
len -= current;
diff --git a/libc/inet/rpc/xdr_reference.c b/libc/inet/rpc/xdr_reference.c
index de310b08a..443ce1c8d 100644
--- a/libc/inet/rpc/xdr_reference.c
+++ b/libc/inet/rpc/xdr_reference.c
@@ -40,9 +40,6 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
* "pointers". See xdr.h for more info on the interface to xdr.
*/
-#define xdr_bool __xdr_bool
-#define fputs __fputs
-
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
@@ -56,8 +53,13 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
# include <wchar.h>
# include <libio/iolibio.h>
# define fputs(s, f) _IO_fputs (s, f)
+libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(memset)
+libc_hidden_proto(xdr_bool)
+libc_hidden_proto(fputs)
+
#define LASTUNSIGNED ((u_int)0-1)
/*
@@ -69,8 +71,8 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
* size is the size of the referneced structure.
* proc is the routine to handle the referenced structure.
*/
-bool_t attribute_hidden
-__xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
+bool_t
+xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
{
caddr_t loc = *pp;
bool_t stat;
@@ -87,14 +89,14 @@ __xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
{
#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- (void) __fwprintf (stderr, L"%s",
+ (void) fwprintf (stderr, L"%s",
_("xdr_reference: out of memory\n"));
else
#endif
(void) fputs (_("xdr_reference: out of memory\n"), stderr);
return FALSE;
}
- __memset (loc, 0, (int) size);
+ memset (loc, 0, (int) size);
break;
default:
break;
@@ -109,7 +111,8 @@ __xdr_reference (XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
}
return stat;
}
-strong_alias(__xdr_reference,xdr_reference)
+libc_hidden_proto(xdr_reference)
+libc_hidden_def(xdr_reference)
/*
* xdr_pointer():
@@ -150,5 +153,5 @@ xdr_pointer (xdrs, objpp, obj_size, xdr_obj)
*objpp = NULL;
return TRUE;
}
- return __xdr_reference (xdrs, objpp, obj_size, xdr_obj);
+ return xdr_reference (xdrs, objpp, obj_size, xdr_obj);
}
diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c
index 5c8aec6f9..8bd08590d 100644
--- a/libc/inet/rpc/xdr_stdio.c
+++ b/libc/inet/rpc/xdr_stdio.c
@@ -37,12 +37,6 @@
* from the stream.
*/
-#define fread __fread
-#define fwrite __fwrite
-#define fseek __fseek
-#define fflush __fflush
-#define ftell __ftell
-
#include <rpc/types.h>
#include <stdio.h>
#include <rpc/xdr.h>
@@ -55,6 +49,12 @@
# define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
#endif
+libc_hidden_proto(fread)
+libc_hidden_proto(fwrite)
+libc_hidden_proto(fseek)
+libc_hidden_proto(fflush)
+libc_hidden_proto(ftell)
+
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int);