extern int __close(int __fd) attribute_hidden;
extern __pid_t __getpid (void) attribute_hidden;
+/* #include <stdio.h> */
+extern void __perror (__const char *__s) attribute_hidden;
+
/* #include <stdlib.h> */
extern char *__getenv (__const char *__name) attribute_hidden;
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);
* 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>
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;
/*
* 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;
}
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)
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)
(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;
#define authnone_create __authnone_create
#define xdrmem_create __xdrmem_create
+#define svc_getreq __svc_getreq
#define __FORCE_GLIBC
#include <features.h>
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);
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
+#define clntudp_create __clntudp_create
+
#define __FORCE_GLIBC
#include <features.h>
* 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;
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)
* 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)
{
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)
* 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;
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)
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);
}
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)
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();
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 *);
return interpret(d);
}
-struct rpcent *getrpcent()
+struct rpcent attribute_hidden *__getrpcent(void)
{
register struct rpcdata *d = _rpcdata();
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)
{
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;
}
{
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;
}
{
int ret;
LOCK;
- ret = __copy_rpcent(getrpcent(), result_buf, buffer, buflen, result);
+ ret = __copy_rpcent(__getrpcent(), result_buf, buffer, buflen, result);
UNLOCK;
return ret;
}
* Client interface to pmap rpc service.
*/
+#define clnt_perror __clnt_perror
+#define clntudp_bufcreate __clntudp_bufcreate
+
#define __FORCE_GLIBC
#include <features.h>
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);
}
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)
* 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;
/* (void)__close(socket); CLNT_DESTROY already closed it */
return rslt;
}
+strong_alias(__pmap_unset,pmap_unset)
* 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>
* 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>
#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>
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;
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) &&
*/
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;
}
(struct sockaddr *) &baddr,
sizeof (struct sockaddr)) != outlen)
{
- perror (_("Cannot send broadcast packet"));
+ __perror (_("Cannot send broadcast packet"));
stat = RPC_CANTSEND;
goto done_broad;
}
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;
{
if (errno == EINTR)
goto try_again;
- perror (_("Cannot receive reply to broadcast"));
+ __perror (_("Cannot receive reply to broadcast"));
stat = RPC_CANTRECV;
goto done_broad;
}
(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));
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) {
timo *= 2;
goto retry;
}
- perror(res0->ai_canonname);
+ __perror(res0->ai_canonname);
return (-1);
}
if (fd2p == 0) {
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)) {
s3 = accept(s2, (struct sockaddr *)&from, &len);
__close(s2);
if (s3 < 0) {
- perror("accept");
+ __perror("accept");
port = 0;
goto bad;
}
free ((char *) pass);
if (__read(s, &c, 1) != 1) {
- perror(*ahost);
+ __perror(*ahost);
goto bad;
}
if (c != 0) {
* routines are also in this program.
*/
+#define xdr_bytes __xdr_bytes
+#define xdr_union __xdr_union
+
#define __FORCE_GLIBC
#include <features.h>
*/
#define pmap_set __pmap_set
+#define pmap_unset __pmap_unset
#define _authenticate _authenticate_internal
#define _rpc_dtablesize _rpc_dtablesize_internal
/* 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)
{
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;
/* now unregister the information with the local binder service */
pmap_unset (prog, vers);
}
+strong_alias(__svc_unregister,svc_unregister)
/* ******************* REPLY GENERATION ROUTINES ************ */
}
/* Can't decode args error reply */
-void
-svcerr_decode (register SVCXPRT *xprt)
+void attribute_hidden
+__svcerr_decode (register SVCXPRT *xprt)
{
struct rpc_msg rply;
rply.acpted_rply.ar_stat = GARBAGE_ARGS;
SVC_REPLY (xprt, &rply);
}
+strong_alias(__svcerr_decode,svcerr_decode)
/* Some system error */
void
}
/* Program unavailable error reply */
-void
-svcerr_noprog (register SVCXPRT *xprt)
+void attribute_hidden
+__svcerr_noprog (register SVCXPRT *xprt)
{
struct rpc_msg rply;
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;
rply.acpted_rply.ar_vers.high = high_vers;
SVC_REPLY (xprt, &rply);
}
+strong_alias(__svcerr_progvers,svcerr_progvers)
/* ******************* SERVER INPUT STUFF ******************* */
* 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;
/* 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:
}
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__
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__ */
* 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
free (my_pollfd);
if (errno == EINTR)
continue;
- perror (_("svc_run: - poll failed"));
+ __perror (_("svc_run: - poll failed"));
return;
case 0:
free (my_pollfd);
*/
#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
{
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;
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;
* 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;
{
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;
}
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;
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)
{
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;
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;
* *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;
}
return FALSE;
}
+strong_alias(__xdr_bytes,xdr_bytes)
/*
* Implemented here due to commonality of the object.
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);
}
/*
* 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;
return ((dfault == NULL_xdrproc_t) ? FALSE :
(*dfault) (xdrs, unp, LASTUNSIGNED));
}
-
+strong_alias(__xdr_union,xdr_union)
/*
* Non-portable xdr primitives.
#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
#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;
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
#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. */
#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
#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__ */
#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); \
} \
#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 */
/**********************************************************************/
#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);
}
#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. */
#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. */
#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;
#define kill __kill
#define getuid __getuid
#define execve __execve
+#define dup2 __dup2
#define _GNU_SOURCE
#include <sys/cdefs.h>
#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
}
#endif
}
+strong_alias(__perror,perror)
#define waitpid __waitpid
#define execl __execl
+#define dup2 __dup2
#include <stdio.h>
#include <stdlib.h>
#define mbsrtowcs __mbsrtowcs
#define mbrtowc __mbrtowc
#define ungetc __ungetc
+#define iswspace __iswspace
#define _ISOC99_SOURCE /* for LLONG_MAX primarily... */
#define _GNU_SOURCE
#define wcsnlen __wcsnlen
#define wcsrtombs __wcsrtombs
#define mbsrtowcs __mbsrtowcs
+#define btowc __btowc
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
* GNU Library Public License for more details.
*/
+#define readlink __readlink
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#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
/**********************************************************************/
+#define iswspace __iswspace
+#define iswspace_l __iswspace_l
+
#define _ISOC99_SOURCE 1
#define _GNU_SOURCE
#include <stdlib.h>
#define getuid __getuid
#define setrlimit __setrlimit
#define waitpid __waitpid
+#define dup2 __dup2
#include <assert.h>
#include <errno.h>
#ifdef __LOCALE_C_ONLY
weak_alias(__strcmp, __strcoll)
-strong_alias(__strcoll, strcoll)
+weak_alias(__strcmp, strcoll)
#endif
#undef L_strcmp
#ifdef __LOCALE_C_ONLY
weak_alias(__wcscmp, __wcscoll)
-strong_alias(__wcscoll, wcscoll)
+weak_alias(__wcscmp, wcscoll)
#endif
#undef L_strcmp
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>
#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)
#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)
* Original copyright notice is retained at the end of this file.
*/
+#define dup2 __dup2
+
#include <stdio.h>
#include <features.h>
#include <fcntl.h>