Browse Source

Convert some users and get rid of __rpc_thread_createerr jump reloc, this was indeed a badly chosen name

Peter S. Mazinger 18 years ago
parent
commit
6a6ae6e1a2

+ 0 - 3
libc/inet/addr.c

@@ -16,9 +16,6 @@
  * Changed to use _int10tostr.
  */
 
-/* for some reason this does not work here */
-#define memmove __memmove
-
 #define _GNU_SOURCE
 #define __FORCE_GLIBC
 #include <features.h>

+ 1 - 0
libc/inet/getnetent.c

@@ -17,6 +17,7 @@
 
 #define inet_network __inet_network
 #define rewind __rewind
+#define fgets __fgets
 
 #define __FORCE_GLIBC
 #include <features.h>

+ 1 - 0
libc/inet/getproto.c

@@ -54,6 +54,7 @@
 #define strpbrk __strpbrk
 #define atoi __atoi
 #define rewind __rewind
+#define fgets __fgets
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/getservice.c

@@ -54,6 +54,7 @@
 #define strpbrk __strpbrk
 #define atoi __atoi
 #define rewind __rewind
+#define fgets __fgets
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 1 - 1
libc/inet/ntop.c

@@ -246,7 +246,7 @@ inet_pton4(const char *src, u_char *dst)
 
 /* We cannot use the macro version of tolower() or very bad
  * things happen when '*src++' gets evaluated multiple times.  
- * So * undef it here so we get the function version of tolower
+ * So undef it here so we get the function version of tolower
  * instead.
  */
 #undef tolower

+ 17 - 9
libc/inet/resolv.c

@@ -149,6 +149,7 @@
 #define recv __recv
 #define send __send
 #define snprintf __snprintf
+#define fgets __fgets
 
 #define __FORCE_GLIBC
 #include <features.h>
@@ -1138,7 +1139,7 @@ struct hostent *gethostbyname2(const char *name, int family)
 #ifdef L_res_init
 struct __res_state _res;
 
-int res_init(void)
+int attribute_hidden __res_init_internal(void)
 {
 	struct __res_state *rp = &(_res);
 
@@ -1183,6 +1184,7 @@ int res_init(void)
 
 	return(0);
 }
+strong_alias(__res_init_internal,res_init)
 
 void res_close( void )
 {
@@ -1198,7 +1200,11 @@ void res_close( void )
 #define MIN(x, y)	((x) < (y) ? (x) : (y))
 #endif
 
-int res_query(const char *dname, int class, int type,
+int		__res_init_internal (void) __THROW attribute_hidden;
+int		__res_querydomain_internal (const char *, const char *, int, int,
+				 u_char *, int) __THROW attribute_hidden;
+
+int attribute_hidden __res_query_internal(const char *dname, int class, int type,
               unsigned char *answer, int anslen)
 {
 	int i;
@@ -1239,6 +1245,7 @@ int res_query(const char *dname, int class, int type,
 		free(packet);
 	return i;
 }
+strong_alias(__res_query_internal,res_query)
 
 /*
  * Formulate a normal query, send, and retrieve answer in supplied buffer.
@@ -1258,7 +1265,7 @@ int res_search(name, class, type, answer, anslen)
 	int trailing_dot, ret, saved_herrno;
 	int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
 
-	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) {
+	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) {
 		h_errno = NETDB_INTERNAL;
 		return (-1);
 	}
@@ -1278,7 +1285,7 @@ int res_search(name, class, type, answer, anslen)
 	 */
 	saved_herrno = -1;
 	if (dots >= _res.ndots) {
-		ret = res_querydomain(name, NULL, class, type, answer, anslen);
+		ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen);
 		if (ret > 0)
 			return (ret);
 		saved_herrno = h_errno;
@@ -1299,7 +1306,7 @@ int res_search(name, class, type, answer, anslen)
 		   *domain && !done;
 		   domain++) {
 
-			ret = res_querydomain(name, *domain, class, type,
+			ret = __res_querydomain_internal(name, *domain, class, type,
 			    answer, anslen);
 			if (ret > 0)
 				return (ret);
@@ -1355,7 +1362,7 @@ int res_search(name, class, type, answer, anslen)
 	 * name or whether it ends with a dot.
 	 */
 	if (!tried_as_is) {
-		ret = res_querydomain(name, NULL, class, type, answer, anslen);
+		ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen);
 		if (ret > 0)
 			return (ret);
 	}
@@ -1381,7 +1388,7 @@ int res_search(name, class, type, answer, anslen)
  * Perform a call on res_query on the concatenation of name and domain,
  * removing a trailing dot from name if domain is NULL.
  */
-int res_querydomain(name, domain, class, type, answer, anslen)
+int attribute_hidden __res_querydomain_internal(name, domain, class, type, answer, anslen)
 	const char *name, *domain;
 	int class, type;	/* class and type of query */
 	u_char *answer;		/* buffer to put answer */
@@ -1391,7 +1398,7 @@ int res_querydomain(name, domain, class, type, answer, anslen)
 	const char *longname = nbuf;
 	size_t n, d;
 
-	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) {
+	if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) {
 		h_errno = NETDB_INTERNAL;
 		return (-1);
 	}
@@ -1425,8 +1432,9 @@ int res_querydomain(name, domain, class, type, answer, anslen)
 		}
 		snprintf(nbuf, sizeof(nbuf), "%s.%s", name, domain);
 	}
-	return (res_query(longname, class, type, answer, anslen));
+	return (__res_query_internal(longname, class, type, answer, anslen));
 }
+strong_alias(__res_querydomain_internal,res_querydomain)
 
 /* res_mkquery */
 /* res_send */

+ 1 - 0
libc/inet/rpc/auth_unix.c

@@ -47,6 +47,7 @@
 #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>

+ 5 - 0
libc/inet/rpc/clnt_generic.c

@@ -47,6 +47,11 @@
 #include <sys/errno.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 ())
+
 /*
  * Generic client creation: takes (hostname, program-number, protocol) and
  * returns client handle. Default options are set, which the user can

+ 5 - 2
libc/inet/rpc/clnt_perror.c

@@ -37,6 +37,9 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  *
  */
+
+#define fputs __fputs
+
 #define __FORCE_GLIBC
 #include <features.h>
 
@@ -245,7 +248,7 @@ __clnt_sperror (CLIENT * rpch, const char *msg)
 
     case RPC_CANTSEND:
     case RPC_CANTRECV:
-      strerror_r (e.re_errno, chrbuf, sizeof chrbuf);
+      __glibc_strerror_r_internal (e.re_errno, chrbuf, sizeof chrbuf);
       len = __sprintf (str, "; errno = %s", chrbuf); 
       str += len;
       break;
@@ -335,7 +338,7 @@ __clnt_spcreateerror (const char *msg)
       (void) __strcpy(cp, " - ");
       cp += __strlen(cp);
 
-      strerror_r (ce->cf_error.re_errno, chrbuf, sizeof chrbuf);
+      __glibc_strerror_r_internal (ce->cf_error.re_errno, chrbuf, sizeof chrbuf);
       (void) __strcpy(cp, chrbuf);
       cp += __strlen(cp);
       break;

+ 6 - 0
libc/inet/rpc/clnt_tcp.c

@@ -63,6 +63,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 #define connect __connect
 #define bindresvport __bindresvport
 #define poll __poll
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #include <features.h>
@@ -81,6 +82,11 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 
 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 ())
+
 #define MCALL_MSG_SIZE 24
 
 struct ct_data

+ 6 - 0
libc/inet/rpc/clnt_udp.c

@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #define sendto __sendto
 #define recvmsg __recvmsg
 #define poll __poll
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #include <features.h>
@@ -80,6 +81,11 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 
 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 ())
+
 /*
  * UDP bases client side rpc operations
  */

+ 6 - 0
libc/inet/rpc/clnt_unix.c

@@ -62,6 +62,7 @@
 #define recvmsg __recvmsg
 #define sendmsg __sendmsg
 #define poll __poll
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #include <features.h>
@@ -81,6 +82,11 @@
 
 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 ())
+
 #define MCALL_MSG_SIZE 24
 
 struct ct_data

+ 3 - 3
libc/inet/rpc/get_myaddress.c

@@ -68,14 +68,14 @@ get_myaddress (struct sockaddr_in *addr)
   if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
     {
       __perror ("get_myaddress: socket");
-      exit (1);
+      __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)"));
-      exit (1);
+      __exit (1);
     }
 
  again:
@@ -86,7 +86,7 @@ get_myaddress (struct sockaddr_in *addr)
       if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
 	{
           __perror ("get_myaddress: ioctl");
-          exit (1);
+          __exit (1);
 	}
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
 	  && (!(ifreq.ifr_flags & IFF_LOOPBACK) ||

+ 1 - 0
libc/inet/rpc/getrpcent.c

@@ -35,6 +35,7 @@
 
 #define atoi __atoi
 #define rewind __rewind
+#define fgets __fgets
 
 #define __FORCE_GLIBC
 #include <features.h>

+ 3 - 3
libc/inet/rpc/pmap_clnt.c

@@ -69,14 +69,14 @@ __get_myaddress (struct sockaddr_in *addr)
   if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
     {
       __perror ("__get_myaddress: socket");
-      exit (1);
+      __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)"));
-      exit (1);
+      __exit (1);
     }
 
  again:
@@ -87,7 +87,7 @@ __get_myaddress (struct sockaddr_in *addr)
       if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
         {
           __perror ("__get_myaddress: ioctl");
-          exit (1);
+          __exit (1);
         }
       if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
           && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0)))

+ 5 - 0
libc/inet/rpc/pmap_getport.c

@@ -45,6 +45,11 @@ static char sccsid[] = "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";
 #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 ())
+
 static const struct timeval timeout =
 {5, 0};
 static const struct timeval tottimeout =

+ 3 - 2
libc/inet/rpc/rcmd.c

@@ -81,6 +81,7 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 
 
 extern int __rresvport(int *alport) attribute_hidden;
+extern int __getc_unlocked (FILE *__stream) attribute_hidden;
 
 /* some forward declarations */
 static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
@@ -664,10 +665,10 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost)
 
 	/* Skip lines that are too long. */
 	if (__strchr (p, '\n') == NULL) {
-	    int ch = getc_unlocked (hostf);
+	    int ch = __getc_unlocked (hostf);
 
 	    while (ch != '\n' && ch != EOF)
-	      ch = getc_unlocked (hostf);
+	      ch = __getc_unlocked (hostf);
 	    continue;
 	}
 

+ 5 - 0
libc/inet/rpc/rpc_private.h

@@ -4,6 +4,11 @@
 /* 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 ())
+
 /*
  * Multi-threaded support
  * Group all global and static variables into a single spot.

+ 7 - 3
libc/inet/rpc/rpc_thread.c

@@ -107,8 +107,8 @@ __rpc_thread_svc_fdset_internal (void)
 }
 strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
 
-struct rpc_createerr *
-__rpc_thread_createerr (void)
+struct rpc_createerr attribute_hidden *
+__rpc_thread_createerr_internal (void)
 {
 	struct rpc_thread_variables *tvp;
 
@@ -117,6 +117,8 @@ __rpc_thread_createerr (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)
@@ -155,11 +157,13 @@ fd_set attribute_hidden * __rpc_thread_svc_fdset_internal (void)
 }
 strong_alias(__rpc_thread_svc_fdset_internal,__rpc_thread_svc_fdset)
 
-struct rpc_createerr * __rpc_thread_createerr (void)
+struct rpc_createerr attribute_hidden * __rpc_thread_createerr_internal (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)
 {

+ 11 - 9
libc/inet/rpc/ruserpass.c

@@ -50,6 +50,8 @@
 #include <string.h>
 #include <unistd.h>
 
+extern int __getc_unlocked (FILE *__stream) attribute_hidden;
+
 #define _(X)  (X)
 /* #include "ftp_var.h" */
 
@@ -219,7 +221,7 @@ 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");
@@ -231,7 +233,7 @@ next:
 			}
 			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;
 			}
@@ -241,7 +243,7 @@ next:
 			}
 			*tmp = '\0';
 			if (c != '\n') {
-				while ((c=getc_unlocked(cfile)) != EOF
+				while ((c=__getc_unlocked(cfile)) != EOF
 				       && c != '\n');
 			}
 			if (c == EOF) {
@@ -256,7 +258,7 @@ next:
 			}
 			tmp = macros[macnum].mac_start;
 			while (tmp != macbuf + 4096) {
-				if ((c=getc_unlocked(cfile)) == EOF) {
+				if ((c=__getc_unlocked(cfile)) == EOF) {
 				__printf("Macro definition missing null line terminator.\n");
 					goto bad;
 				}
@@ -300,24 +302,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;
 		}
 	}

+ 4 - 3
libc/inet/rpc/svc_simple.c

@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
 #define svcudp_create __svcudp_create
 #define pmap_unset __pmap_unset
 #define asprintf __asprintf
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
@@ -159,7 +160,7 @@ 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);
+	  __exit (1);
 	}
       return;
     }
@@ -184,7 +185,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);
@@ -198,5 +199,5 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
 #endif
     fputs (buf, stderr);
   free (buf);
-  exit (1);
+  __exit (1);
 }

+ 1 - 0
libc/inet/rpc/svc_tcp.c

@@ -55,6 +55,7 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 #define poll __poll
 #define accept __accept
 #define listen __listen
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/rpc/svc_udp.c

@@ -52,6 +52,7 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
 #define sendto __sendto
 #define recvmsg __recvmsg
 #define sendmsg __sendmsg
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/rpc/svc_unix.c

@@ -55,6 +55,7 @@
 #define poll __poll
 #define accept __accept
 #define listen __listen
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #include <features.h>

+ 2 - 0
libc/inet/rpc/xdr.c

@@ -41,6 +41,8 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
  * xdr.
  */
 
+#define fputs __fputs
+
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #include <features.h>

+ 1 - 0
libc/inet/rpc/xdr_array.c

@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
  */
 
 #define xdr_u_int __xdr_u_int
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 2 - 0
libc/inet/rpc/xdr_rec.c

@@ -44,6 +44,8 @@
  * The other 31 bits encode the byte length of the fragment.
  */
 
+#define fputs __fputs
+
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #include <features.h>

+ 1 - 0
libc/inet/rpc/xdr_reference.c

@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
  */
 
 #define xdr_bool __xdr_bool
+#define fputs __fputs
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

+ 1 - 0
libc/inet/rpc/xdr_stdio.c

@@ -41,6 +41,7 @@
 #define fwrite __fwrite
 #define fseek __fseek
 #define fflush __fflush
+#define ftell __ftell
 
 #include <rpc/types.h>
 #include <stdio.h>