summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/rpc/auth_unix.c2
-rw-r--r--libc/inet/rpc/clnt_generic.c4
-rw-r--r--libc/inet/rpc/clnt_perror.c211
-rw-r--r--libc/inet/rpc/clnt_raw.c3
-rw-r--r--libc/inet/rpc/clnt_simple.c2
-rw-r--r--libc/inet/rpc/clnt_tcp.c5
-rw-r--r--libc/inet/rpc/clnt_udp.c17
-rw-r--r--libc/inet/rpc/clnt_unix.c5
-rw-r--r--libc/inet/rpc/get_myaddress.c6
-rw-r--r--libc/inet/rpc/getrpcent.c103
-rw-r--r--libc/inet/rpc/pmap_clnt.c14
-rw-r--r--libc/inet/rpc/pmap_getmaps.c3
-rw-r--r--libc/inet/rpc/pmap_getport.c2
-rw-r--r--libc/inet/rpc/pmap_rmt.c15
-rw-r--r--libc/inet/rpc/rcmd.c2
-rw-r--r--libc/inet/rpc/rexec.c10
-rw-r--r--libc/inet/rpc/rpc_prot.c3
-rw-r--r--libc/inet/rpc/svc.c139
-rw-r--r--libc/inet/rpc/svc_run.c4
-rw-r--r--libc/inet/rpc/svc_simple.c4
-rw-r--r--libc/inet/rpc/svc_tcp.c4
-rw-r--r--libc/inet/rpc/svc_udp.c19
-rw-r--r--libc/inet/rpc/svc_unix.c4
-rw-r--r--libc/inet/rpc/xdr.c22
-rw-r--r--libc/misc/regex/_regex.h24
-rw-r--r--libc/misc/regex/regex.c13
-rw-r--r--libc/misc/regex/regex_old.c3
-rw-r--r--libc/misc/wctype/wctype.c23
-rw-r--r--libc/misc/wordexp/wordexp.c1
-rw-r--r--libc/stdio/perror.c3
-rw-r--r--libc/stdio/popen.c1
-rw-r--r--libc/stdio/scanf.c1
-rw-r--r--libc/stdio/vfprintf.c1
-rw-r--r--libc/stdlib/realpath.c2
-rw-r--r--libc/stdlib/stdlib.c2
-rw-r--r--libc/stdlib/strtod.c3
-rw-r--r--libc/stdlib/unix_grantpt.c1
-rw-r--r--libc/string/strcmp.c2
-rw-r--r--libc/string/wcscmp.c2
-rw-r--r--libc/sysdeps/linux/arm/ioperm.c2
-rw-r--r--libc/sysdeps/linux/common/dup2.c4
-rw-r--r--libc/sysdeps/linux/common/readlink.c4
-rw-r--r--libc/unistd/daemon.c2
43 files changed, 380 insertions, 317 deletions
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c
index 9c16774fd..ca4e89bab 100644
--- a/libc/inet/rpc/auth_unix.c
+++ b/libc/inet/rpc/auth_unix.c
@@ -322,7 +322,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/clnt_generic.c b/libc/inet/rpc/clnt_generic.c
index 3e2998477..1b30d2e1c 100644
--- a/libc/inet/rpc/clnt_generic.c
+++ b/libc/inet/rpc/clnt_generic.c
@@ -30,6 +30,10 @@
* Copyright (C) 1987, Sun Microsystems, Inc.
*/
+#define clnttcp_create __clnttcp_create
+#define clntudp_create __clntudp_create
+#define clntunix_create __clntunix_create
+
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c
index 6561e2631..9173f17af 100644
--- a/libc/inet/rpc/clnt_perror.c
+++ b/libc/inet/rpc/clnt_perror.c
@@ -71,105 +71,6 @@ _buf (void)
return buf;
}
-/*
- * Print reply error info
- */
-char *
-clnt_sperror (CLIENT * rpch, const char *msg)
-{
- char chrbuf[1024];
- struct rpc_err e;
- char *err;
- char *str = _buf ();
- char *strstart = str;
- int len;
-
- if (str == NULL)
- return NULL;
- CLNT_GETERR (rpch, &e);
-
- len = sprintf (str, "%s: ", msg);
- str += len;
-
- (void) __strcpy(str, clnt_sperrno(e.re_status));
- str += __strlen(str);
-
- switch (e.re_status)
- {
- case RPC_SUCCESS:
- case RPC_CANTENCODEARGS:
- case RPC_CANTDECODERES:
- case RPC_TIMEDOUT:
- case RPC_PROGUNAVAIL:
- case RPC_PROCUNAVAIL:
- case RPC_CANTDECODEARGS:
- case RPC_SYSTEMERROR:
- case RPC_UNKNOWNHOST:
- case RPC_UNKNOWNPROTO:
- case RPC_PMAPFAILURE:
- case RPC_PROGNOTREGISTERED:
- case RPC_FAILED:
- break;
-
- case RPC_CANTSEND:
- case RPC_CANTRECV:
- 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"),
- 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);
-
- if (err != NULL)
- {
- (void) __strcpy(str, err);
- str += __strlen(str);
- }
- else
- {
- 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"),
- 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);
- str += len;
- break;
- }
- *str = '\n';
- *++str = '\0';
- return (strstart);
-}
-
-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));
- else
-#endif
- (void) fputs (clnt_sperror (rpch, msg), stderr);
-}
-
-
struct rpc_errtab
{
enum clnt_stat status;
@@ -275,8 +176,8 @@ static const struct rpc_errtab rpc_errlist[] =
/*
* This interface for use by clntrpc
*/
-char *
-clnt_sperrno (enum clnt_stat stat)
+char attribute_hidden *
+__clnt_sperrno (enum clnt_stat stat)
{
size_t i;
@@ -289,18 +190,118 @@ clnt_sperrno (enum clnt_stat stat)
}
return _("RPC: (unknown error code)");
}
+strong_alias(__clnt_sperrno,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 chrbuf[1024];
+ struct rpc_err e;
+ char *err;
+ char *str = _buf ();
+ char *strstart = str;
+ int len;
+
+ if (str == NULL)
+ return NULL;
+ CLNT_GETERR (rpch, &e);
+
+ len = sprintf (str, "%s: ", msg);
+ str += len;
+
+ (void) __strcpy(str, __clnt_sperrno(e.re_status));
+ str += __strlen(str);
+
+ switch (e.re_status)
+ {
+ case RPC_SUCCESS:
+ case RPC_CANTENCODEARGS:
+ case RPC_CANTDECODERES:
+ case RPC_TIMEDOUT:
+ case RPC_PROGUNAVAIL:
+ case RPC_PROCUNAVAIL:
+ case RPC_CANTDECODEARGS:
+ case RPC_SYSTEMERROR:
+ case RPC_UNKNOWNHOST:
+ case RPC_UNKNOWNPROTO:
+ case RPC_PMAPFAILURE:
+ case RPC_PROGNOTREGISTERED:
+ case RPC_FAILED:
+ break;
+
+ case RPC_CANTSEND:
+ case RPC_CANTRECV:
+ 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"),
+ 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);
+
+ if (err != NULL)
+ {
+ (void) __strcpy(str, err);
+ str += __strlen(str);
+ }
+ else
+ {
+ 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"),
+ 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);
+ str += len;
+ break;
+ }
+ *str = '\n';
+ *++str = '\0';
+ return (strstart);
}
+strong_alias(__clnt_sperror,clnt_sperror)
+void attribute_hidden
+__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));
+ else
+#endif
+ (void) fputs (__clnt_sperror (rpch, msg), stderr);
+}
+strong_alias(__clnt_perror,clnt_perror)
char attribute_hidden *
__clnt_spcreateerror (const char *msg)
@@ -316,7 +317,7 @@ __clnt_spcreateerror (const char *msg)
ce = &get_rpc_createerr ();
len = sprintf (str, "%s: ", msg);
cp = str + len;
- (void) __strcpy(cp, clnt_sperrno (ce->cf_stat));
+ (void) __strcpy(cp, __clnt_sperrno (ce->cf_stat));
cp += __strlen(cp);
switch (ce->cf_stat)
@@ -325,7 +326,7 @@ __clnt_spcreateerror (const char *msg)
(void) __strcpy(cp, " - ");
cp += __strlen(cp);
- (void) __strcpy(cp, clnt_sperrno (ce->cf_error.re_status));
+ (void) __strcpy(cp, __clnt_sperrno (ce->cf_error.re_status));
cp += __strlen(cp);
break;
diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c
index 41143496a..1dbbbb8a8 100644
--- a/libc/inet/rpc/clnt_raw.c
+++ b/libc/inet/rpc/clnt_raw.c
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
#define authnone_create __authnone_create
#define xdrmem_create __xdrmem_create
+#define svc_getreq __svc_getreq
#define __FORCE_GLIBC
#include <features.h>
@@ -116,7 +117,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 dede4a028..9105fc266 100644
--- a/libc/inet/rpc/clnt_simple.c
+++ b/libc/inet/rpc/clnt_simple.c
@@ -38,6 +38,8 @@ 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 __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index c04265d8f..99c5751eb 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/libc/inet/rpc/clnt_tcp.c
@@ -122,8 +122,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 *
-clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
+CLIENT attribute_hidden *
+__clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
int *sockp, u_int sendsz, u_int recvsz)
{
CLIENT *h;
@@ -239,6 +239,7 @@ fooy:
mem_free ((caddr_t) h, sizeof (CLIENT));
return ((CLIENT *) NULL);
}
+strong_alias(__clnttcp_create,clnttcp_create)
static enum clnt_stat
clnttcp_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c
index 4aba505b2..81fe9f7bc 100644
--- a/libc/inet/rpc/clnt_udp.c
+++ b/libc/inet/rpc/clnt_udp.c
@@ -129,8 +129,8 @@ struct cu_data
* sendsz and recvsz are the maximum allowable packet sizes that can be
* sent and received.
*/
-CLIENT *
-clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
+CLIENT attribute_hidden *
+__clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
struct timeval wait, int *sockp, u_int sendsz,
u_int recvsz)
{
@@ -227,19 +227,16 @@ fooy:
mem_free ((caddr_t) cl, sizeof (CLIENT));
return (CLIENT *) NULL;
}
+strong_alias(__clntudp_bufcreate,clntudp_bufcreate)
-CLIENT *
-clntudp_create (raddr, program, version, wait, sockp)
- struct sockaddr_in *raddr;
- u_long program;
- u_long version;
- struct timeval wait;
- int *sockp;
+CLIENT attribute_hidden *
+__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)
static int
is_network_up (int sock)
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index 3af68d9c8..3dbcc8d36 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/libc/inet/rpc/clnt_unix.c
@@ -120,8 +120,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 *
-clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
+CLIENT attribute_hidden *
+__clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
int *sockp, u_int sendsz, u_int recvsz)
{
CLIENT *h;
@@ -218,6 +218,7 @@ fooy:
mem_free ((caddr_t) h, sizeof (CLIENT));
return (CLIENT *) NULL;
}
+strong_alias(__clntunix_create,clntunix_create)
static enum clnt_stat
clntunix_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c
index ef2c2f52e..684e4d7ec 100644
--- a/libc/inet/rpc/get_myaddress.c
+++ b/libc/inet/rpc/get_myaddress.c
@@ -67,14 +67,14 @@ get_myaddress (struct sockaddr_in *addr)
if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
{
- perror ("get_myaddress: socket");
+ __perror ("get_myaddress: socket");
exit (1);
}
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
{
- perror (_("get_myaddress: ioctl (get interface configuration)"));
+ __perror (_("get_myaddress: ioctl (get interface configuration)"));
exit (1);
}
@@ -85,7 +85,7 @@ get_myaddress (struct sockaddr_in *addr)
ifreq = *ifr;
if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
{
- perror ("get_myaddress: ioctl");
+ __perror ("get_myaddress: ioctl");
exit (1);
}
if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index 47a0b0c13..bc6ab7057 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -73,41 +73,26 @@ static struct rpcdata *_rpcdata(void)
return d;
}
-struct rpcent *getrpcbynumber(register int number)
+void attribute_hidden __endrpcent(void)
{
register struct rpcdata *d = _rpcdata();
- register struct rpcent *rpc;
if (d == NULL)
- return NULL;
- setrpcent(0);
- while ((rpc = getrpcent())) {
- if (rpc->r_number == number)
- break;
+ return;
+ if (d->stayopen)
+ return;
+ if (d->current) {
+ free(d->current);
+ d->current = NULL;
}
- endrpcent();
- return rpc;
-}
-
-struct rpcent *getrpcbyname(const char *name)
-{
- struct rpcent *rpc;
- char **rp;
-
- 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)
- return rpc;
- }
+ if (d->rpcf) {
+ fclose(d->rpcf);
+ d->rpcf = NULL;
}
- endrpcent();
- return NULL;
}
+strong_alias(__endrpcent,endrpcent)
-void setrpcent(int f)
+void attribute_hidden __setrpcent(int f)
{
register struct rpcdata *d = _rpcdata();
@@ -122,24 +107,7 @@ void setrpcent(int f)
d->current = NULL;
d->stayopen |= f;
}
-
-void endrpcent()
-{
- register struct rpcdata *d = _rpcdata();
-
- if (d == NULL)
- return;
- if (d->stayopen)
- return;
- if (d->current) {
- free(d->current);
- d->current = NULL;
- }
- if (d->rpcf) {
- fclose(d->rpcf);
- d->rpcf = NULL;
- }
-}
+strong_alias(__setrpcent,setrpcent)
static struct rpcent *interpret(struct rpcdata *);
@@ -150,7 +118,7 @@ static struct rpcent *__get_next_rpcent(struct rpcdata *d)
return interpret(d);
}
-struct rpcent *getrpcent()
+struct rpcent attribute_hidden *__getrpcent(void)
{
register struct rpcdata *d = _rpcdata();
@@ -160,6 +128,43 @@ struct rpcent *getrpcent()
return NULL;
return __get_next_rpcent(d);
}
+strong_alias(__getrpcent,getrpcent)
+
+struct rpcent attribute_hidden *__getrpcbynumber(register int number)
+{
+ register struct rpcdata *d = _rpcdata();
+ register struct rpcent *rpc;
+
+ if (d == NULL)
+ return NULL;
+ __setrpcent(0);
+ while ((rpc = __getrpcent())) {
+ if (rpc->r_number == number)
+ break;
+ }
+ __endrpcent();
+ return rpc;
+}
+strong_alias(__getrpcbynumber,getrpcbynumber)
+
+struct rpcent attribute_hidden *__getrpcbyname(const char *name)
+{
+ struct rpcent *rpc;
+ char **rp;
+
+ __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)
+ return rpc;
+ }
+ }
+ __endrpcent();
+ return NULL;
+}
+strong_alias(__getrpcbyname,getrpcbyname)
#ifdef __linux__
static char *firstwhite(char *s)
@@ -319,7 +324,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;
}
@@ -329,7 +334,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;
}
@@ -339,7 +344,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/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c
index 39d846f3b..666745442 100644
--- a/libc/inet/rpc/pmap_clnt.c
+++ b/libc/inet/rpc/pmap_clnt.c
@@ -34,6 +34,9 @@
* Client interface to pmap rpc service.
*/
+#define clnt_perror __clnt_perror
+#define clntudp_bufcreate __clntudp_bufcreate
+
#define __FORCE_GLIBC
#include <features.h>
@@ -64,14 +67,14 @@ __get_myaddress (struct sockaddr_in *addr)
if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
{
- perror ("__get_myaddress: socket");
+ __perror ("__get_myaddress: socket");
exit (1);
}
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
{
- perror (_("__get_myaddress: ioctl (get interface configuration)"));
+ __perror (_("__get_myaddress: ioctl (get interface configuration)"));
exit (1);
}
@@ -82,7 +85,7 @@ __get_myaddress (struct sockaddr_in *addr)
ifreq = *ifr;
if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
{
- perror ("__get_myaddress: ioctl");
+ __perror ("__get_myaddress: ioctl");
exit (1);
}
if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
@@ -148,8 +151,8 @@ strong_alias(__pmap_set,pmap_set)
* Remove the mapping between program,version and port.
* Calls the pmap service remotely to do the un-mapping.
*/
-bool_t
-pmap_unset (u_long program, u_long version)
+bool_t attribute_hidden
+__pmap_unset (u_long program, u_long version)
{
struct sockaddr_in myaddress;
int socket = -1;
@@ -172,3 +175,4 @@ pmap_unset (u_long program, u_long version)
/* (void)__close(socket); CLNT_DESTROY already closed it */
return rslt;
}
+strong_alias(__pmap_unset,pmap_unset)
diff --git a/libc/inet/rpc/pmap_getmaps.c b/libc/inet/rpc/pmap_getmaps.c
index 4ec2d40e9..84736e03e 100644
--- a/libc/inet/rpc/pmap_getmaps.c
+++ b/libc/inet/rpc/pmap_getmaps.c
@@ -39,6 +39,9 @@ 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>
diff --git a/libc/inet/rpc/pmap_getport.c b/libc/inet/rpc/pmap_getport.c
index 79492747b..1981cfaa1 100644
--- a/libc/inet/rpc/pmap_getport.c
+++ b/libc/inet/rpc/pmap_getport.c
@@ -38,6 +38,8 @@ 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>
diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c
index 5a78ba2c9..d612bec4d 100644
--- a/libc/inet/rpc/pmap_rmt.c
+++ b/libc/inet/rpc/pmap_rmt.c
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
#define authunix_create_default __authunix_create_default
#define xdrmem_create __xdrmem_create
#define inet_makeaddr __inet_makeaddr
+#define clntudp_create __clntudp_create
#define __FORCE_GLIBC
#include <features.h>
@@ -189,7 +190,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
ifc.ifc_buf = buf;
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;
@@ -198,7 +199,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
ifreq = *ifr;
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) &&
@@ -268,14 +269,14 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
*/
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;
}
@@ -326,7 +327,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;
}
@@ -351,7 +352,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;
@@ -364,7 +365,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;
}
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index 43fe44cc2..bd95a7e0c 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -173,7 +173,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));
diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c
index b93cf7644..e5e8d42de 100644
--- a/libc/inet/rpc/rexec.c
+++ b/libc/inet/rpc/rexec.c
@@ -87,7 +87,7 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
retry:
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) {
@@ -97,7 +97,7 @@ retry:
timo *= 2;
goto retry;
}
- perror(res0->ai_canonname);
+ __perror(res0->ai_canonname);
return (-1);
}
if (fd2p == 0) {
@@ -115,7 +115,7 @@ retry:
listen(s2, 1);
sa2len = sizeof (sa2);
if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
- perror("getsockname");
+ __perror("getsockname");
(void) __close(s2);
goto bad;
} else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) {
@@ -134,7 +134,7 @@ retry:
s3 = accept(s2, (struct sockaddr *)&from, &len);
__close(s2);
if (s3 < 0) {
- perror("accept");
+ __perror("accept");
port = 0;
goto bad;
}
@@ -154,7 +154,7 @@ retry:
free ((char *) pass);
if (__read(s, &c, 1) != 1) {
- perror(*ahost);
+ __perror(*ahost);
goto bad;
}
if (c != 0) {
diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c
index c64ddf8f0..bbe7b57f2 100644
--- a/libc/inet/rpc/rpc_prot.c
+++ b/libc/inet/rpc/rpc_prot.c
@@ -44,6 +44,9 @@ 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 __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c
index faccab58e..727abcbd8 100644
--- a/libc/inet/rpc/svc.c
+++ b/libc/inet/rpc/svc.c
@@ -37,6 +37,7 @@
*/
#define pmap_set __pmap_set
+#define pmap_unset __pmap_unset
#define _authenticate _authenticate_internal
#define _rpc_dtablesize _rpc_dtablesize_internal
@@ -174,8 +175,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
-svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
+bool_t attribute_hidden
+__svc_register (SVCXPRT * xprt, rpcprog_t prog, rpcvers_t vers,
void (*dispatch) (struct svc_req *, SVCXPRT *),
rpcproc_t protocol)
{
@@ -205,10 +206,11 @@ pmap_it:
return TRUE;
}
+strong_alias(__svc_register,svc_register)
/* Remove a service program from the callout list. */
-void
-svc_unregister (rpcprog_t prog, rpcvers_t vers)
+void attribute_hidden
+__svc_unregister (rpcprog_t prog, rpcvers_t vers)
{
struct svc_callout *prev;
register struct svc_callout *s;
@@ -226,6 +228,7 @@ 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)
/* ******************* REPLY GENERATION ROUTINES ************ */
@@ -260,8 +263,8 @@ svcerr_noproc (register SVCXPRT *xprt)
}
/* Can't decode args error reply */
-void
-svcerr_decode (register SVCXPRT *xprt)
+void attribute_hidden
+__svcerr_decode (register SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -271,6 +274,7 @@ svcerr_decode (register SVCXPRT *xprt)
rply.acpted_rply.ar_stat = GARBAGE_ARGS;
SVC_REPLY (xprt, &rply);
}
+strong_alias(__svcerr_decode,svcerr_decode)
/* Some system error */
void
@@ -307,8 +311,8 @@ svcerr_weakauth (SVCXPRT *xprt)
}
/* Program unavailable error reply */
-void
-svcerr_noprog (register SVCXPRT *xprt)
+void attribute_hidden
+__svcerr_noprog (register SVCXPRT *xprt)
{
struct rpc_msg rply;
@@ -318,10 +322,11 @@ svcerr_noprog (register SVCXPRT *xprt)
rply.acpted_rply.ar_stat = PROG_UNAVAIL;
SVC_REPLY (xprt, &rply);
}
+strong_alias(__svcerr_noprog,svcerr_noprog)
/* Program version mismatch error reply */
-void
-svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
+void attribute_hidden
+__svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
rpcvers_t high_vers)
{
struct rpc_msg rply;
@@ -334,6 +339,7 @@ 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)
/* ******************* SERVER INPUT STUFF ******************* */
@@ -353,58 +359,8 @@ svcerr_progvers (register SVCXPRT *xprt, rpcvers_t low_vers,
* is mallocated in kernel land.
*/
-void
-svc_getreq (int rdfds)
-{
- fd_set readfds;
-
- FD_ZERO (&readfds);
- readfds.fds_bits[0] = rdfds;
- svc_getreqset (&readfds);
-}
-
-void
-svc_getreqset (fd_set *readfds)
-{
- register u_int32_t mask;
- register u_int32_t *maskp;
- register int setsize;
- register int sock;
- register int bit;
-
- setsize = _rpc_dtablesize ();
- 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);
-}
-
-void
-svc_getreq_poll (struct pollfd *pfdp, int pollretval)
-{
- register int i;
- register int fds_found;
-
- for (i = fds_found = 0; i < svc_max_pollfd && fds_found < pollretval; ++i)
- {
- register struct pollfd *p = &pfdp[i];
-
- if (p->fd != -1 && p->revents)
- {
- /* fd has input waiting */
- ++fds_found;
-
- if (p->revents & POLLNVAL)
- xprt_unregister (xports[p->fd]);
- else
- svc_getreq_common (p->fd);
- }
- }
-}
-
-
-void
-svc_getreq_common (const int fd)
+void attribute_hidden
+__svc_getreq_common (const int fd)
{
enum xprt_stat stat;
struct rpc_msg msg;
@@ -478,9 +434,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:
@@ -492,6 +448,59 @@ svc_getreq_common (const int fd)
}
while (stat == XPRT_MOREREQS);
}
+strong_alias(__svc_getreq_common,svc_getreq_common)
+
+void attribute_hidden
+__svc_getreqset (fd_set *readfds)
+{
+ register u_int32_t mask;
+ register u_int32_t *maskp;
+ register int setsize;
+ register int sock;
+ register int bit;
+
+ setsize = _rpc_dtablesize ();
+ 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);
+}
+strong_alias(__svc_getreqset,svc_getreqset)
+
+void attribute_hidden
+__svc_getreq (int rdfds)
+{
+ fd_set readfds;
+
+ FD_ZERO (&readfds);
+ readfds.fds_bits[0] = rdfds;
+ __svc_getreqset (&readfds);
+}
+strong_alias(__svc_getreq,svc_getreq)
+
+void attribute_hidden
+__svc_getreq_poll (struct pollfd *pfdp, int pollretval)
+{
+ register int i;
+ register int fds_found;
+
+ for (i = fds_found = 0; i < svc_max_pollfd && fds_found < pollretval; ++i)
+ {
+ register struct pollfd *p = &pfdp[i];
+
+ if (p->fd != -1 && p->revents)
+ {
+ /* fd has input waiting */
+ ++fds_found;
+
+ if (p->revents & POLLNVAL)
+ xprt_unregister (xports[p->fd]);
+ else
+ __svc_getreq_common (p->fd);
+ }
+ }
+}
+strong_alias(__svc_getreq_poll,svc_getreq_poll)
#ifdef __UCLIBC_HAS_THREADS__
@@ -500,7 +509,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_run.c b/libc/inet/rpc/svc_run.c
index c0d3b34f0..b46320871 100644
--- a/libc/inet/rpc/svc_run.c
+++ b/libc/inet/rpc/svc_run.c
@@ -31,6 +31,8 @@
* Wait for input, call server program.
*/
+#define svc_getreq_poll __svc_getreq_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
@@ -80,7 +82,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 e9a43b97a..e0509be70 100644
--- a/libc/inet/rpc/svc_simple.c
+++ b/libc/inet/rpc/svc_simple.c
@@ -39,6 +39,10 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
*/
#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 __FORCE_GLIBC
#define _GNU_SOURCE
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index 20deb8719..58c8ed1fd 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -159,7 +159,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
{
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;
@@ -174,7 +174,7 @@ 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);
return (SVCXPRT *) NULL;
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index ab6f96ee1..019e40273 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -115,10 +115,8 @@ struct svcudp_data
* see (svc.h, xprt_register).
* The routines returns NULL if a problem occurred.
*/
-SVCXPRT *
-svcudp_bufcreate (sock, sendsz, recvsz)
- int sock;
- u_int sendsz, recvsz;
+SVCXPRT attribute_hidden *
+__svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
{
bool_t madesock = FALSE;
SVCXPRT *xprt;
@@ -132,7 +130,7 @@ svcudp_bufcreate (sock, sendsz, recvsz)
{
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;
@@ -146,7 +144,7 @@ svcudp_bufcreate (sock, sendsz, recvsz)
}
if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
{
- perror (_("svcudp_create - cannot getsockname"));
+ __perror (_("svcudp_create - cannot getsockname"));
if (madesock)
(void) __close (sock);
return (SVCXPRT *) NULL;
@@ -206,14 +204,15 @@ svcudp_bufcreate (sock, sendsz, recvsz)
xprt_register (xprt);
return xprt;
}
+strong_alias(__svcudp_bufcreate,svcudp_bufcreate)
-SVCXPRT *
-svcudp_create (sock)
- int sock;
+SVCXPRT attribute_hidden *
+__svcudp_create (int sock)
{
- return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
+ return __svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
}
+strong_alias(__svcudp_create,svcudp_create)
static enum xprt_stat
svcudp_stat (xprt)
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index bc4cb2c20..0b7d964fd 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -154,7 +154,7 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
{
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;
@@ -170,7 +170,7 @@ 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);
return (SVCXPRT *) NULL;
diff --git a/libc/inet/rpc/xdr.c b/libc/inet/rpc/xdr.c
index 46e214431..c608cd27f 100644
--- a/libc/inet/rpc/xdr.c
+++ b/libc/inet/rpc/xdr.c
@@ -519,12 +519,8 @@ xdr_opaque (XDR *xdrs, caddr_t cp, u_int cnt)
* *cpp is a pointer to the bytes, *sizep is the count.
* If *cpp is NULL maxsize bytes are allocated
*/
-bool_t
-xdr_bytes (xdrs, cpp, sizep, maxsize)
- XDR *xdrs;
- char **cpp;
- u_int *sizep;
- u_int maxsize;
+bool_t attribute_hidden
+__xdr_bytes (XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int nodesize;
@@ -581,6 +577,7 @@ xdr_bytes (xdrs, cpp, sizep, maxsize)
}
return FALSE;
}
+strong_alias(__xdr_bytes,xdr_bytes)
/*
* Implemented here due to commonality of the object.
@@ -591,7 +588,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);
}
/*
@@ -605,13 +602,8 @@ xdr_netobj (xdrs, np)
* routine may be called.
* If there is no specific or default routine an error is returned.
*/
-bool_t
-xdr_union (xdrs, dscmp, unp, choices, dfault)
- XDR *xdrs;
- enum_t *dscmp; /* enum to decide which arm to work on */
- char *unp; /* the union itself */
- const struct xdr_discrim *choices; /* [value, xdr proc] for each arm */
- xdrproc_t dfault; /* default xdr routine */
+bool_t attribute_hidden
+__xdr_union (XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
{
enum_t dscm;
@@ -640,7 +632,7 @@ xdr_union (xdrs, dscmp, unp, choices, dfault)
return ((dfault == NULL_xdrproc_t) ? FALSE :
(*dfault) (xdrs, unp, LASTUNSIGNED));
}
-
+strong_alias(__xdr_union,xdr_union)
/*
* Non-portable xdr primitives.
diff --git a/libc/misc/regex/_regex.h b/libc/misc/regex/_regex.h
index cf3a5a2c1..01bb21158 100644
--- a/libc/misc/regex/_regex.h
+++ b/libc/misc/regex/_regex.h
@@ -4,42 +4,42 @@
#include <regex.h>
/* Document internal interfaces. */
-extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax);
+extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax) attribute_hidden;
extern const char *__re_compile_pattern (const char *pattern, size_t length,
- struct re_pattern_buffer *buffer);
+ struct re_pattern_buffer *buffer) attribute_hidden;
-extern int __re_compile_fastmap (struct re_pattern_buffer *buffer);
+extern int __re_compile_fastmap (struct re_pattern_buffer *buffer) attribute_hidden;
extern int __re_search (struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range,
- struct re_registers *regs);
+ struct re_registers *regs) attribute_hidden;
extern int __re_search_2
(struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
- int start, int range, struct re_registers *regs, int stop);
+ int start, int range, struct re_registers *regs, int stop) attribute_hidden;
extern int __re_match
(struct re_pattern_buffer *buffer, const char *string,
- int length, int start, struct re_registers *regs);
+ int length, int start, struct re_registers *regs) attribute_hidden;
extern int __re_match_2
(struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
- int start, struct re_registers *regs, int stop);
+ int start, struct re_registers *regs, int stop) attribute_hidden;
extern void __re_set_registers
(struct re_pattern_buffer *buffer, struct re_registers *regs,
- unsigned num_regs, regoff_t *starts, regoff_t *ends);
+ unsigned num_regs, regoff_t *starts, regoff_t *ends) attribute_hidden;
-extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags);
+extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags) attribute_hidden;
extern int __regexec (const regex_t *__preg, const char *__string,
- size_t __nmatch, regmatch_t __pmatch[], int __eflags);
+ size_t __nmatch, regmatch_t __pmatch[], int __eflags) attribute_hidden;
extern size_t __regerror (int __errcode, const regex_t *__preg,
- char *__errbuf, size_t __errbuf_size);
+ char *__errbuf, size_t __errbuf_size) attribute_hidden;
-extern void __regfree (regex_t *__preg);
+extern void __regfree (regex_t *__preg) attribute_hidden;
#endif
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 789e78b49..0eefa85c9 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -32,9 +32,17 @@
#include <stdint.h>
#ifdef __UCLIBC_HAS_WCHAR__
#define RE_ENABLE_I18N
+#define wcscoll __wcscoll
+#define mbrtowc __mbrtowc
+#define iswctype __iswctype
+#define iswlower __iswlower
+#define iswalnum __iswalnum
#include <wchar.h>
#include <wctype.h>
+/* attribute_hidden produces text relocation */
+//extern int __wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW /*attribute_hidden*/;
+
extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
mbstate_t *__restrict __ps) attribute_hidden;
@@ -42,7 +50,7 @@ extern wint_t __btowc (int __c) attribute_hidden;
extern wctype_t __wctype (__const char *__property) attribute_hidden;
-extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
+//extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
#endif
#define memcmp __memcmp
@@ -55,10 +63,9 @@ extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
#define strncpy __strncpy
#define getenv __getenv
#define strcasecmp __strcasecmp
-#define wcscoll __wcscoll
extern void *__mempcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n) /*attribute_hidden*/;
+ __const void *__restrict __src, size_t __n) attribute_hidden;
#endif
/* Make sure noone compiles this code with a C++ compiler. */
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 486e29c40..ab471ee1e 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -28,7 +28,10 @@
#define wcslen __wcslen
/* for some reason this does not work */
#define memcpy __memcpy
+#define mbrtowc __mbrtowc
#define wcscoll __wcscoll
+#define iswctype __iswctype
+#define iswalnum __iswalnum
/* To exclude some unwanted junk.... */
#undef _LIBC
diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c
index c256400e7..77d7572da 100644
--- a/libc/misc/wctype/wctype.c
+++ b/libc/misc/wctype/wctype.c
@@ -48,7 +48,7 @@ extern wctype_t __wctype (__const char *__property) attribute_hidden;
#include <xlocale.h>
extern wint_t __towlower_l(wint_t __wc, __locale_t __locale) __THROW;
extern wint_t __towupper_l(wint_t __wc, __locale_t __locale) __THROW;
-extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW;
+//extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW attribute_hidden;
extern wint_t __towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW;
#endif /* __UCLIBC_HAS_XLOCALE__ */
@@ -181,10 +181,10 @@ enum {
#ifdef __UCLIBC_DO_XLOCALE
extern int __iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
- __THROW;
+ __THROW attribute_hidden;
#define ISW_FUNC_BODY(NAME) \
-int __PASTE3(__isw,NAME,_l) (wint_t wc, __locale_t l) \
+int attribute_hidden __PASTE3(__isw,NAME,_l) (wint_t wc, __locale_t l) \
{ \
return __iswctype_l(wc, __PASTE2(_CTYPE_is,NAME), l); \
} \
@@ -192,13 +192,14 @@ weak_alias(__PASTE3(__isw,NAME,_l), __PASTE3(isw,NAME,_l))
#else /* __UCLIBC_DO_XLOCALE */
-extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW;
+extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW attribute_hidden;
#define ISW_FUNC_BODY(NAME) \
-int __PASTE2(isw,NAME) (wint_t wc) \
+int attribute_hidden __PASTE2(__isw,NAME) (wint_t wc) \
{ \
return __iswctype(wc, __PASTE2(_CTYPE_is,NAME)); \
-}
+} \
+weak_alias(__PASTE2(__isw,NAME), __PASTE2(isw,NAME))
#endif /* __UCLIBC_DO_XLOCALE */
/**********************************************************************/
@@ -514,7 +515,7 @@ strong_alias(__wctype,wctype)
#warning REMINDER: Currently wctype_l simply calls wctype.
#endif /* __UCLIBC_MJN3_ONLY__ */
-wctype_t __wctype_l (const char *property, __locale_t locale)
+wctype_t attribute_hidden __wctype_l (const char *property, __locale_t locale)
{
return __wctype(property);
}
@@ -568,7 +569,7 @@ static const unsigned short int desc2flag[] = {
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
/* Note... wctype_t is unsigned. */
@@ -582,7 +583,7 @@ int __iswctype(wint_t wc, wctype_t desc)
#else /* __UCLIBC_HAS_CTYPE_TABLES__ */
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
/* This is lame, but it is here just to get it working for now. */
@@ -641,14 +642,14 @@ int __iswctype(wint_t wc, wctype_t desc)
#if defined(L_iswctype) && defined(__UCLIBC_HAS_XLOCALE__)
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
return __iswctype_l(wc, desc, __UCLIBC_CURLOCALE);
}
#else /* defined(L_iswctype) && defined(__UCLIBC_HAS_XLOCALE__) */
-int ISWCTYPE(wint_t wc, wctype_t desc)
+int attribute_hidden ISWCTYPE(wint_t wc, wctype_t desc)
{
unsigned int sc, n, i0, i1;
unsigned char d = __CTYPE_unclassified;
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index 9cdeaf162..7cac06f69 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/libc/misc/wordexp/wordexp.c
@@ -28,6 +28,7 @@
#define kill __kill
#define getuid __getuid
#define execve __execve
+#define dup2 __dup2
#define _GNU_SOURCE
#include <sys/cdefs.h>
diff --git a/libc/stdio/perror.c b/libc/stdio/perror.c
index 26a0cebd9..d69ccd5c3 100644
--- a/libc/stdio/perror.c
+++ b/libc/stdio/perror.c
@@ -11,7 +11,7 @@
#warning CONSIDER: Increase buffer size for error message (non-%m case)?
#endif
-void perror(register const char *s)
+void attribute_hidden __perror(register const char *s)
{
/* If the program is calling perror, it's a safe bet that printf and
* friends are used as well. It is also possible that the calling
@@ -34,3 +34,4 @@ void perror(register const char *s)
}
#endif
}
+strong_alias(__perror,perror)
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index 2e9985a39..00c2d7bb1 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -16,6 +16,7 @@
#define waitpid __waitpid
#define execl __execl
+#define dup2 __dup2
#include <stdio.h>
#include <stdlib.h>
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index 19484d588..4db939f93 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -47,6 +47,7 @@
#define mbsrtowcs __mbsrtowcs
#define mbrtowc __mbrtowc
#define ungetc __ungetc
+#define iswspace __iswspace
#define _ISOC99_SOURCE /* for LLONG_MAX primarily... */
#define _GNU_SOURCE
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index e3f389a6b..d835038ba 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -93,6 +93,7 @@
#define wcsnlen __wcsnlen
#define wcsrtombs __wcsrtombs
#define mbsrtowcs __mbsrtowcs
+#define btowc __btowc
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
diff --git a/libc/stdlib/realpath.c b/libc/stdlib/realpath.c
index 7266ba4c6..2a018b4b7 100644
--- a/libc/stdlib/realpath.c
+++ b/libc/stdlib/realpath.c
@@ -13,6 +13,8 @@
* GNU Library Public License for more details.
*/
+#define readlink __readlink
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 04c85d32f..0c78c4c70 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -36,6 +36,8 @@
#define mbsrtowcs __mbsrtowcs
#define mbrtowc __mbrtowc
#define mbrlen __mbrlen
+#define iswspace __iswspace
+#define iswspace_l __iswspace_l
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c
index 47f809f3e..1468877bc 100644
--- a/libc/stdlib/strtod.c
+++ b/libc/stdlib/strtod.c
@@ -95,6 +95,9 @@
/**********************************************************************/
+#define iswspace __iswspace
+#define iswspace_l __iswspace_l
+
#define _ISOC99_SOURCE 1
#define _GNU_SOURCE
#include <stdlib.h>
diff --git a/libc/stdlib/unix_grantpt.c b/libc/stdlib/unix_grantpt.c
index 1f1c4df5c..bf451a4d3 100644
--- a/libc/stdlib/unix_grantpt.c
+++ b/libc/stdlib/unix_grantpt.c
@@ -22,6 +22,7 @@
#define getuid __getuid
#define setrlimit __setrlimit
#define waitpid __waitpid
+#define dup2 __dup2
#include <assert.h>
#include <errno.h>
diff --git a/libc/string/strcmp.c b/libc/string/strcmp.c
index 654ca302a..5cdbe6f73 100644
--- a/libc/string/strcmp.c
+++ b/libc/string/strcmp.c
@@ -13,7 +13,7 @@ strong_alias(__strcmp, strcmp)
#ifdef __LOCALE_C_ONLY
weak_alias(__strcmp, __strcoll)
-strong_alias(__strcoll, strcoll)
+weak_alias(__strcmp, strcoll)
#endif
#undef L_strcmp
diff --git a/libc/string/wcscmp.c b/libc/string/wcscmp.c
index 5501a4dac..505148140 100644
--- a/libc/string/wcscmp.c
+++ b/libc/string/wcscmp.c
@@ -14,7 +14,7 @@ strong_alias(__wcscmp, wcscmp)
#ifdef __LOCALE_C_ONLY
weak_alias(__wcscmp, __wcscoll)
-strong_alias(__wcscoll, wcscoll)
+weak_alias(__wcscmp, wcscoll)
#endif
#undef L_strcmp
diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c
index f887d54f1..d69d475d6 100644
--- a/libc/sysdeps/linux/arm/ioperm.c
+++ b/libc/sysdeps/linux/arm/ioperm.c
@@ -33,6 +33,8 @@
the area affected (this is a kernel limitation). So we now just
enable all the ports all of the time. */
+#define readlink __readlink
+
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
diff --git a/libc/sysdeps/linux/common/dup2.c b/libc/sysdeps/linux/common/dup2.c
index a5a832f6f..71164aa0b 100644
--- a/libc/sysdeps/linux/common/dup2.c
+++ b/libc/sysdeps/linux/common/dup2.c
@@ -9,4 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-_syscall2(int, dup2, int, oldfd, int, newfd);
+#define __NR___dup2 __NR_dup2
+attribute_hidden _syscall2(int, __dup2, int, oldfd, int, newfd);
+strong_alias(__dup2,dup2)
diff --git a/libc/sysdeps/linux/common/readlink.c b/libc/sysdeps/linux/common/readlink.c
index 8ebb5eaa9..45db1a64f 100644
--- a/libc/sysdeps/linux/common/readlink.c
+++ b/libc/sysdeps/linux/common/readlink.c
@@ -9,4 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-_syscall3(int, readlink, const char *, path, char *, buf, size_t, bufsiz);
+#define __NR___readlink __NR_readlink
+attribute_hidden _syscall3(int, __readlink, const char *, path, char *, buf, size_t, bufsiz);
+strong_alias(__readlink,readlink)
diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c
index 3c54ad234..a1dfabfe3 100644
--- a/libc/unistd/daemon.c
+++ b/libc/unistd/daemon.c
@@ -23,6 +23,8 @@
* Original copyright notice is retained at the end of this file.
*/
+#define dup2 __dup2
+
#include <stdio.h>
#include <features.h>
#include <fcntl.h>