Browse Source

More hiding, including __mempcpy

Peter S. Mazinger 18 years ago
parent
commit
c885bf5cf9
100 changed files with 310 additions and 258 deletions
  1. 0 1
      Makefile.in
  2. 4 0
      include/libc-internal.h
  3. 0 83
      include/ssp-internal.h
  4. 4 0
      include/string.h
  5. 4 2
      libc/inet/getaddrinfo.c
  6. 4 0
      libc/inet/getnetbyad.c
  7. 4 0
      libc/inet/getnetbynm.c
  8. 6 4
      libc/inet/getnetent.c
  9. 45 40
      libc/inet/getservice.c
  10. 1 0
      libc/inet/resolv.c
  11. 2 0
      libc/inet/rpc/auth_none.c
  12. 1 0
      libc/inet/rpc/auth_unix.c
  13. 1 1
      libc/inet/rpc/bindresvport.c
  14. 1 0
      libc/inet/rpc/clnt_raw.c
  15. 1 0
      libc/inet/rpc/clnt_tcp.c
  16. 1 0
      libc/inet/rpc/clnt_udp.c
  17. 2 1
      libc/inet/rpc/clnt_unix.c
  18. 3 0
      libc/inet/rpc/create_xid.c
  19. 3 2
      libc/inet/rpc/pmap_clnt.c
  20. 1 0
      libc/inet/rpc/pmap_rmt.c
  21. 2 1
      libc/inet/rpc/rcmd.c
  22. 2 0
      libc/inet/rpc/rpc_dtablesize.c
  23. 1 1
      libc/inet/rpc/ruserpass.c
  24. 2 0
      libc/inet/rpc/svc.c
  25. 2 0
      libc/inet/rpc/svc_auth_unix.c
  26. 2 0
      libc/inet/rpc/svc_raw.c
  27. 1 0
      libc/inet/rpc/svc_udp.c
  28. 1 1
      libc/inet/rpc/svc_unix.c
  29. 3 2
      libc/inet/rpc/xdr_mem.c
  30. 1 1
      libc/misc/file/lockf.c
  31. 1 1
      libc/misc/file/lockf64.c
  32. 2 0
      libc/misc/ftw/ftw.c
  33. 1 1
      libc/misc/internals/tempname.c
  34. 2 1
      libc/misc/locale/locale.c
  35. 4 0
      libc/misc/regex/regex.c
  36. 4 0
      libc/misc/search/hsearch.c
  37. 6 6
      libc/misc/search/hsearch_r.c
  38. 2 1
      libc/misc/search/tsearch.c
  39. 25 17
      libc/misc/syslog/syslog.c
  40. 2 2
      libc/misc/sysvipc/shm.c
  41. 2 1
      libc/misc/time/adjtime.c
  42. 18 9
      libc/misc/time/time.c
  43. 1 1
      libc/misc/utmp/wtent.c
  44. 7 4
      libc/misc/wordexp/wordexp.c
  45. 3 0
      libc/pwd_grp/lckpwdf.c
  46. 2 0
      libc/signal/killpg.c
  47. 4 1
      libc/signal/raise.c
  48. 7 14
      libc/signal/sigaction.c
  49. 3 4
      libc/signal/sigdelset.c
  50. 3 3
      libc/signal/sigfillset.c
  51. 2 0
      libc/signal/sigignore.c
  52. 2 0
      libc/signal/sigintr.c
  53. 2 0
      libc/signal/signal.c
  54. 2 0
      libc/signal/sigpause.c
  55. 2 0
      libc/signal/sigrelse.c
  56. 2 0
      libc/signal/sigset.c
  57. 2 0
      libc/signal/sysv_signal.c
  58. 2 3
      libc/stdio/getdelim.c
  59. 4 3
      libc/stdio/getline.c
  60. 2 1
      libc/stdio/open_memstream.c
  61. 1 0
      libc/stdio/popen.c
  62. 2 0
      libc/stdio/vasprintf.c
  63. 2 0
      libc/stdlib/abort.c
  64. 2 0
      libc/stdlib/drand48.c
  65. 2 0
      libc/stdlib/drand48_r.c
  66. 1 0
      libc/stdlib/erand48.c
  67. 2 5
      libc/stdlib/erand48_r.c
  68. 2 1
      libc/stdlib/getenv.c
  69. 2 0
      libc/stdlib/jrand48.c
  70. 2 4
      libc/stdlib/jrand48_r.c
  71. 2 0
      libc/stdlib/lrand48.c
  72. 4 1
      libc/stdlib/lrand48_r.c
  73. 1 1
      libc/stdlib/malloc/malloc_debug.c
  74. 2 0
      libc/stdlib/mrand48.c
  75. 2 0
      libc/stdlib/mrand48_r.c
  76. 2 0
      libc/stdlib/nrand48.c
  77. 2 4
      libc/stdlib/nrand48_r.c
  78. 2 0
      libc/stdlib/srand48.c
  79. 2 3
      libc/stdlib/srand48_r.c
  80. 2 0
      libc/stdlib/system.c
  81. 1 0
      libc/stdlib/unix_grantpt.c
  82. 1 1
      libc/stdlib/valloc.c
  83. 1 1
      libc/string/generic/mempcpy.c
  84. 4 3
      libc/sysdeps/linux/arm/sigaction.c
  85. 1 1
      libc/sysdeps/linux/common/__rt_sigtimedwait.c
  86. 1 1
      libc/sysdeps/linux/common/__syscall_rt_sigaction.c
  87. 1 1
      libc/sysdeps/linux/common/__syscall_sigaction.c
  88. 5 3
      libc/sysdeps/linux/common/adjtimex.c
  89. 2 0
      libc/sysdeps/linux/common/alarm.c
  90. 2 0
      libc/sysdeps/linux/common/clock_settime.c
  91. 1 1
      libc/sysdeps/linux/common/getdirname.c
  92. 2 2
      libc/sysdeps/linux/common/getdtablesize.c
  93. 4 3
      libc/sysdeps/linux/common/getpagesize.c
  94. 6 5
      libc/sysdeps/linux/common/getpid.c
  95. 1 1
      libc/sysdeps/linux/common/getppid.c
  96. 2 1
      libc/sysdeps/linux/common/kill.c
  97. 2 0
      libc/sysdeps/linux/common/ntp_gettime.c
  98. 2 0
      libc/sysdeps/linux/common/poll.c
  99. 3 1
      libc/sysdeps/linux/common/setitimer.c
  100. 3 1
      libc/sysdeps/linux/common/settimeofday.c

+ 0 - 1
Makefile.in

@@ -111,7 +111,6 @@ install_headers:
 	fi ; \
 	tar -chf - --exclude .svn $$extra_exclude include \
 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
-	$(RM) $(PREFIX)$(DEVEL_PREFIX)include/ssp-internal.h
 	$(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
 ifneq ($(UCLIBC_HAS_FLOATS),y)
 	# Remove floating point related headers since float support is disabled.

+ 4 - 0
include/libc-internal.h

@@ -155,6 +155,10 @@ extern char *__strdup (__const char *__s) attribute_hidden;
 extern ssize_t __read(int __fd, void *__buf, size_t __nbytes) attribute_hidden;
 extern ssize_t __write(int __fd, __const void *__buf, size_t __n) attribute_hidden;
 extern int __close(int __fd) attribute_hidden;
+extern __pid_t __getpid (void) attribute_hidden;
+
+/* #include <stdlib.h> */
+extern char *__getenv (__const char *__name) attribute_hidden;
 
 /* #include <signal.h> */
 extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set,

+ 0 - 83
include/ssp-internal.h

@@ -1,83 +0,0 @@
-/*
- * Distributed under the terms of the GNU Lesser General Public License
- *  $Header: $
- */
-
-#ifndef _SSP_INTERNAL_H
-#define _SSP_INTERNAL_H 1
-
-#ifdef __SSP__
-#error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector"
-#endif
-
-#ifdef __PROPOLICE_BLOCK_SEGV__
-# define SSP_SIGTYPE SIGSEGV
-#else
-# define SSP_SIGTYPE SIGABRT
-#endif
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <linux/unistd.h>
-
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef __SSP_QUICK_CANARY__
-#define __NR___kernel_open		__NR_open
-static __always_inline _syscall3(int,__kernel_open,const char *,path,int,flags,__kernel_mode_t,mode);
-#define OPEN(path, flags, mode)		__kernel_open(path, flags, mode)
-
-/* void * = __ptr_t */
-#define __NR___kernel_read		__NR_read
-static __always_inline _syscall3(ssize_t,__kernel_read,int,fd,void *,buf,size_t,count);
-#define READ(fd, buf, count)		__kernel_read(fd, buf, count)
-
-#define __NR___kernel_close		__NR_close
-static __always_inline _syscall1(int,__kernel_close,int,fd);
-#define CLOSE(fd)			__kernel_close(fd)
-#endif
-
-/* const void * = const __ptr_t */
-#define __NR___kernel_write		__NR_write
-static __always_inline _syscall3(ssize_t,__kernel_write,int,fd,const void *,buf,size_t,count);
-#define WRITE(fd, buf, count)		__kernel_write(fd, buf, count)
-
-/* not using __NR_ */
-#define __NR___kernel_gettimeofday	__NR_gettimeofday
-static __always_inline _syscall2(int,__kernel_gettimeofday,struct timeval *,tv,struct timezone *,tz);
-#define GETTIMEOFDAY(tv, tz)		__kernel_gettimeofday(tv, tz)
-
-#define __NR___kernel_getpid		__NR_getpid
-static __always_inline _syscall0(pid_t,__kernel_getpid);
-#define GETPID()			__kernel_getpid()
-
-//#ifdef __NR_rt_sigaction
-//#define __NR___kernel_sigaction	__NR_rt_sigaction
-//static __always_inline _syscall4(...);
-//#else
-#define __NR___kernel_sigaction		__NR_sigaction
-static __always_inline _syscall3(int,__kernel_sigaction,int,signum,const struct sigaction *,act,struct sigaction *,oldact);
-//#endif
-#define SIGACTION(signum, act, oldact)	__kernel_sigaction(signum, act, oldact)
-
-//#ifdef __NR_rt_sigprocmask
-//#define __NR___kernel_sigprocmask	__NR_rt_sigprocmask
-//static __always_inline _syscall4(...);
-//#else
-#define __NR___kernel_sigprocmask	__NR_sigprocmask
-static __always_inline _syscall3(int,__kernel_sigprocmask,int,how,const sigset_t *,set,sigset_t *,oldset);
-//#endif
-#define SIGPROCMASK(how, set, oldset)	__kernel_sigprocmask(how, set, oldset)
-
-#define __NR___kernel_kill		__NR_kill
-static __always_inline _syscall2(int,__kernel_kill,__kernel_pid_t,pid,int,sig);
-#define KILL(pid, sig)			__kernel_kill(pid, sig)
-
-#define __NR___kernel_exit		__NR_exit
-static __always_inline _syscall1(void,__kernel_exit,int,status);
-#define EXIT(status)			__kernel_exit(status)
-
-#endif /* _SSP_INTERNAL_H */

+ 4 - 0
include/string.h

@@ -236,9 +236,11 @@ extern void *memmem (__const void *__haystack, size_t __haystacklen,
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
+#if 0 /* uClibc: disabled */
 extern void *__mempcpy (void *__restrict __dest,
 			__const void *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
+#endif
 extern void *mempcpy (void *__restrict __dest,
 		      __const void *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
@@ -302,7 +304,9 @@ extern char * __REDIRECT (strerror_r,
 
 /* We define this function always since `bzero' is sometimes needed when
    the namespace rules does not allow this.  */
+#if 0 /* uClibc: disabled */
 extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+#endif
 
 #ifdef __USE_BSD
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */

+ 4 - 2
libc/inet/getaddrinfo.c

@@ -44,8 +44,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 /* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
 
-/* strdupa is using these */
+#define getservbyname_r __getservbyname_r
 #if 0
+#define stpcpy __stpcpy
+/* strdupa is using these */
 #define memcpy __memcpy
 #define strlen __strlen
 #endif
@@ -246,7 +248,7 @@ gaih_local (const char *name, const struct gaih_service *service,
 		sizeof (sunp->sun_path))
 		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
 
-	    __stpcpy (__stpcpy (sunp->sun_path, P_tmpdir "/"), service->name);
+	    stpcpy (stpcpy (sunp->sun_path, P_tmpdir "/"), service->name);
 	}
     }
     else

+ 4 - 0
libc/inet/getnetbyad.c

@@ -15,6 +15,10 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#define setnetent __setnetent
+#define getnetent __getnetent
+#define endnetent __endnetent
+
 #define __FORCE_GLIBC
 #include <features.h>
 #include <netdb.h>

+ 4 - 0
libc/inet/getnetbynm.c

@@ -15,6 +15,10 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#define setnetent __setnetent
+#define getnetent __getnetent
+#define endnetent __endnetent
+
 #define __FORCE_GLIBC
 #include <features.h>
 #include <netdb.h>

+ 6 - 4
libc/inet/getnetent.c

@@ -44,7 +44,7 @@ static char *net_aliases[MAXALIASES];
 
 int _net_stayopen;
 
-void setnetent(int f)
+void attribute_hidden __setnetent(int f)
 {
     LOCK;
     if (netf == NULL)
@@ -55,8 +55,9 @@ void setnetent(int f)
     UNLOCK;
     return;
 }
+strong_alias(__setnetent,setnetent)
 
-void endnetent(void)
+void attribute_hidden __endnetent(void)
 {
     LOCK;
     if (netf) {
@@ -66,6 +67,7 @@ void endnetent(void)
     _net_stayopen = 0;
     UNLOCK;
 }
+strong_alias(__endnetent,endnetent)
 
 static char * any(register char *cp, char *match)
 {
@@ -80,7 +82,7 @@ static char * any(register char *cp, char *match)
     return ((char *)0);
 }
 
-struct netent * getnetent(void)
+struct netent attribute_hidden * __getnetent(void)
 {
     char *p;
     register char *cp, **q;
@@ -139,4 +141,4 @@ again:
     UNLOCK;
     return (&net);
 }
-
+strong_alias(__getnetent,getnetent)

+ 45 - 40
libc/inet/getservice.c

@@ -98,7 +98,7 @@ static void __initbuf(void)
     }
 }
 
-void setservent(int f)
+extern void attribute_hidden __setservent(int f)
 {
     LOCK;
     if (servf == NULL)
@@ -108,8 +108,9 @@ void setservent(int f)
     serv_stayopen |= f;
     UNLOCK;
 }
+strong_alias(__setservent,setservent)
 
-void endservent(void)
+extern void attribute_hidden __endservent(void)
 {
     LOCK;
     if (servf) {
@@ -119,37 +120,9 @@ void endservent(void)
     serv_stayopen = 0;
     UNLOCK;
 }
+strong_alias(__endservent,endservent)
 
-struct servent * getservent(void)
-{
-    struct servent *result;
-
-    __initbuf();
-    getservent_r(&serv, servbuf, SBUFSIZE, &result);
-    return result;
-}
-
-
-struct servent *getservbyname(const char *name, const char *proto)
-{
-    struct servent *result;
-
-    __initbuf();
-    getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
-    return result;
-}
-
-
-struct servent * getservbyport(int port, const char *proto)
-{
-    struct servent *result;
-
-    __initbuf();
-    getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
-    return result;
-}
-
-int getservent_r(struct servent * result_buf,
+extern int attribute_hidden __getservent_r(struct servent * result_buf,
 		 char * buf, size_t buflen,
 		 struct servent ** result)
 {
@@ -228,8 +201,18 @@ again:
     UNLOCK;
     return 0;
 }
+strong_alias(__getservent_r,getservent_r)
 
-int getservbyname_r(const char *name, const char *proto,
+struct servent * getservent(void)
+{
+    struct servent *result;
+
+    __initbuf();
+    __getservent_r(&serv, servbuf, SBUFSIZE, &result);
+    return result;
+}
+
+extern int attribute_hidden __getservbyname_r(const char *name, const char *proto,
 	struct servent * result_buf, char * buf, size_t buflen,
 	struct servent ** result)
 {
@@ -237,8 +220,8 @@ int getservbyname_r(const char *name, const char *proto,
     int ret;
 
     LOCK;
-    setservent(serv_stayopen);
-    while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
+    __setservent(serv_stayopen);
+    while (!(ret=__getservent_r(result_buf, buf, buflen, result))) {
 	if (__strcmp(name, result_buf->s_name) == 0)
 	    goto gotname;
 	for (cp = result_buf->s_aliases; *cp; cp++)
@@ -250,27 +233,49 @@ gotname:
 	    break;
     }
     if (!serv_stayopen)
-	endservent();
+	__endservent();
     UNLOCK;
     return *result?0:ret;
 }
+strong_alias(__getservbyname_r,getservbyname_r)
+
+struct servent *getservbyname(const char *name, const char *proto)
+{
+    struct servent *result;
+
+    __initbuf();
+    __getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
+    return result;
+}
+
 
-int getservbyport_r(int port, const char *proto,
+extern int attribute_hidden __getservbyport_r(int port, const char *proto,
 	struct servent * result_buf, char * buf,
 	size_t buflen, struct servent ** result)
 {
     int ret;
 
     LOCK;
-    setservent(serv_stayopen);
-    while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
+    __setservent(serv_stayopen);
+    while (!(ret=__getservent_r(result_buf, buf, buflen, result))) {
 	if (result_buf->s_port != port)
 	    continue;
 	if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0)
 	    break;
     }
     if (!serv_stayopen)
-	endservent();
+	__endservent();
     UNLOCK;
     return *result?0:ret;
 }
+strong_alias(__getservbyport_r,getservbyport_r)
+
+struct servent attribute_hidden * __getservbyport(int port, const char *proto)
+{
+    struct servent *result;
+
+    __initbuf();
+    __getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
+    return result;
+}
+strong_alias(__getservbyport,getservbyport)

+ 1 - 0
libc/inet/resolv.c

@@ -137,6 +137,7 @@
 #define strncat __strncat
 #define strstr __strstr
 #define random __random
+#define getservbyport __getservbyport
 
 #define __FORCE_GLIBC
 #include <features.h>

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

@@ -35,6 +35,8 @@
  * credentials and verifiers to remote systems.
  */
 
+#define xdrmem_create __xdrmem_create
+
 #define __FORCE_GLIBC
 #include <features.h>
 #include "rpc_private.h"

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

@@ -40,6 +40,7 @@
 
 #define sysconf __sysconf
 #define getegid __getegid
+#define xdrmem_create __xdrmem_create
 
 #define __FORCE_GLIBC
 #include <features.h>

+ 1 - 1
libc/inet/rpc/bindresvport.c

@@ -69,7 +69,7 @@ bindresvport (int sd, struct sockaddr_in *sin)
 
   if (port == 0)
     {
-      port = (getpid () % NPORTS) + STARTPORT;
+      port = (__getpid () % NPORTS) + STARTPORT;
     }
   res = -1;
   __set_errno (EADDRINUSE);

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

@@ -43,6 +43,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 __FORCE_GLIBC
 #include <features.h>

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

@@ -52,6 +52,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 
 #define authnone_create __authnone_create
 #define xdrrec_create __xdrrec_create
+#define xdrmem_create __xdrmem_create
 
 #define __FORCE_GLIBC
 #include <features.h>

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

@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #define __cmsg_nxthdr __libc_cmsg_nxthdr
 
 #define authnone_create __authnone_create
+#define xdrmem_create __xdrmem_create
 
 #define __FORCE_GLIBC
 #include <features.h>

+ 2 - 1
libc/inet/rpc/clnt_unix.c

@@ -48,6 +48,7 @@
 
 #define authnone_create __authnone_create
 #define xdrrec_create __xdrrec_create
+#define xdrmem_create __xdrmem_create
 #define getegid __getegid
 
 #define __FORCE_GLIBC
@@ -506,7 +507,7 @@ __msgwrite (int sock, void *data, size_t cnt)
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      It would be much better, if the kernel could pass both to the server. */
-  cred.pid = getpid ();
+  cred.pid = __getpid ();
   cred.uid = geteuid ();
   cred.gid = getegid ();
 

+ 3 - 0
libc/inet/rpc/create_xid.c

@@ -17,6 +17,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define lrand48_r __lrand48_r
+#define srand48_r __srand48_r
+
 #define __FORCE_GLIBC
 #include <features.h>
 

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

@@ -112,8 +112,8 @@ static const struct timeval tottimeout = {60, 0};
  * Set a mapping between program,version and port.
  * Calls the pmap service remotely to do the mapping.
  */
-bool_t
-pmap_set (u_long program, u_long version, int protocol, u_short port)
+bool_t attribute_hidden
+__pmap_set (u_long program, u_long version, int protocol, u_short port)
 {
   struct sockaddr_in myaddress;
   int socket = -1;
@@ -142,6 +142,7 @@ pmap_set (u_long program, u_long version, int protocol, u_short port)
   /* (void)__close(socket); CLNT_DESTROY closes it */
   return rslt;
 }
+strong_alias(__pmap_set,pmap_set)
 
 /*
  * Remove the mapping between program,version and port.

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

@@ -40,6 +40,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 __FORCE_GLIBC

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

@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
 
 #define bcopy __bcopy
 #define sysconf __sysconf
+#define getline __getline
 
 #define __FORCE_GLIBC
 #include <features.h>
@@ -88,7 +89,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 	int s, lport, timo;
 	char c;
 
-	pid = getpid();
+	pid = __getpid();
 
 #ifdef __UCLIBC_HAS_REENTRANT_RPC__
 	hstbuflen = 1024;

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

@@ -31,6 +31,8 @@
 static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
 #endif
 
+#define getdtablesize __getdtablesize
+
 #define __FORCE_GLIBC
 #define __USE_BSD
 #include <features.h>

+ 1 - 1
libc/inet/rpc/ruserpass.c

@@ -105,7 +105,7 @@ int ruserpass(const char *host, const char **aname, const char **apass)
 	/* Give up when running a setuid or setgid app. */
 	if ((getuid() != geteuid()) || getgid() != getegid())
 	    return -1;
-	hdir = getenv("HOME");
+	hdir = __getenv("HOME");
 	if (hdir == NULL) {
 		/* If we can't get HOME, fail instead of trying ".",
 		   which is no improvement. */

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

@@ -36,6 +36,8 @@
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
 
+#define pmap_set __pmap_set
+
 #define _authenticate __libc__authenticate
 #define _rpc_dtablesize __libc__rpc_dtablesize
 

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

@@ -38,6 +38,8 @@
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
 
+#define xdrmem_create __xdrmem_create
+
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #include <features.h>

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

@@ -40,6 +40,8 @@ static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
 
+#define xdrmem_create __xdrmem_create
+
 #define __FORCE_GLIBC
 #include <features.h>
 #include "rpc_private.h"

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

@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
  */
 
 #define xprt_register __xprt_register
+#define xdrmem_create __xdrmem_create
 
 #define __FORCE_GLIBC
 #define _GNU_SOURCE

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

@@ -376,7 +376,7 @@ __msgwrite (int sock, void *data, size_t cnt)
   /* XXX I'm not sure, if gete?id() is always correct, or if we should use
      get?id(). But since keyserv needs geteuid(), we have no other chance.
      It would be much better, if the kernel could pass both to the server. */
-  cred.pid = getpid ();
+  cred.pid = __getpid ();
   cred.uid = geteuid ();
   cred.gid = getegid ();
 

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

@@ -75,8 +75,8 @@ static const struct xdr_ops xdrmem_ops =
  * The procedure xdrmem_create initializes a stream descriptor for a
  * memory buffer.
  */
-void
-xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
+void attribute_hidden
+__xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
 {
   xdrs->x_op = op;
   /* We have to add the const since the `struct xdr_ops' in `struct XDR'
@@ -85,6 +85,7 @@ xdrmem_create (XDR *xdrs, const caddr_t addr, u_int size, enum xdr_op op)
   xdrs->x_private = xdrs->x_base = addr;
   xdrs->x_handy = size;
 }
+strong_alias(__xdrmem_create,xdrmem_create)
 
 /*
  * Nothing needs to be done for the memory case.  The argument is clearly

+ 1 - 1
libc/misc/file/lockf.c

@@ -43,7 +43,7 @@ int lockf (int fd, int cmd, off_t len)
 	    fl.l_type = F_RDLCK;
 	    if (fcntl (fd, F_GETLK, &fl) < 0)
 		return -1;
-	    if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
+	    if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
 		return 0;
 	    __set_errno(EACCES);
 	    return -1;

+ 1 - 1
libc/misc/file/lockf64.c

@@ -77,7 +77,7 @@ int lockf64 (int fd, int cmd, off64_t len64)
 	    fl.l_type = F_RDLCK;
 	    if (fcntl (fd, F_GETLK, &fl) < 0)
 		return -1;
-	    if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
+	    if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
 		return 0;
 	    __set_errno(EACCES);
 	    return -1;

+ 2 - 0
libc/misc/ftw/ftw.c

@@ -22,7 +22,9 @@
 #define strlen __strlen
 
 #define mempcpy __mempcpy
+#define stpcpy __stpcpy
 #define tsearch __tsearch
+#define tdestroy __tdestroy
 
 #define _GNU_SOURCE
 #include <features.h>

+ 1 - 1
libc/misc/internals/tempname.c

@@ -146,7 +146,7 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
 	uint32_t high, low, rh;
 	static uint64_t value;
 	gettimeofday(&tv, NULL);
-	value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid();
+	value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ __getpid();
 	low = value & UINT32_MAX;
 	high = value >> 32;
 	for (i = 0; i < len; ++i) {

+ 2 - 1
libc/misc/locale/locale.c

@@ -46,6 +46,7 @@
  *    locale support had (8-bit codesets only).
  */
 
+#define stpcpy __stpcpy
 #define strtok_r __strtok_r
 
 #define _GNU_SOURCE
@@ -1241,7 +1242,7 @@ __locale_t __newlocale(int category_mask, const char *locale, __locale_t base)
 				j = 0;
 				do {
 					p = envstr[j];
-				} while ((++j < 4) && (!(p = getenv(p)) || !*p));
+				} while ((++j < 4) && (!(p = __getenv(p)) || !*p));
 
 
 				/* The user set something... is it valid? */

+ 4 - 0
libc/misc/regex/regex.c

@@ -53,6 +53,10 @@ extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
 #define strcmp __strcmp
 #define strlen __strlen
 #define strncpy __strncpy
+#define getenv __getenv
+
+extern void *__mempcpy (void *__restrict __dest,
+			__const void *__restrict __src, size_t __n) /*attribute_hidden*/;
 #endif
 
 /* Make sure noone compiles this code with a C++ compiler.  */

+ 4 - 0
libc/misc/search/hsearch.c

@@ -17,6 +17,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define hdestroy_r __hdestroy_r
+#define hsearch_r __hsearch_r
+#define hcreate_r __hcreate_r
+
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif

+ 6 - 6
libc/misc/search/hsearch_r.c

@@ -67,7 +67,7 @@ static int isprime (unsigned int number)
    indexing as explained in the comment for the hsearch function.
    The contents of the table is zeroed, especially the field used
    becomes zero.  */
-int hcreate_r (size_t nel, struct hsearch_data *htab)
+int attribute_hidden __hcreate_r (size_t nel, struct hsearch_data *htab)
 {
   /* Test for correct arguments.  */
   if (htab == NULL)
@@ -96,13 +96,13 @@ int hcreate_r (size_t nel, struct hsearch_data *htab)
   /* everything went alright */
   return 1;
 }
-/* libc_hidden_def (hcreate_r) */
+strong_alias(__hcreate_r,hcreate_r)
 #endif
 
 #ifdef L_hdestroy_r
 /* After using the hash table it has to be destroyed. The used memory can
    be freed and the local static variable can be marked as not used.  */
-void hdestroy_r (struct hsearch_data *htab)
+void attribute_hidden __hdestroy_r (struct hsearch_data *htab)
 {
   /* Test for correct arguments.  */
   if (htab == NULL)
@@ -118,7 +118,7 @@ void hdestroy_r (struct hsearch_data *htab)
   /* the sign for an existing table is an value != NULL in htable */
   htab->table = NULL;
 }
-/* libc_hidden_def (hdestroy_r) */
+strong_alias(__hdestroy_r,hdestroy_r)
 #endif
 
 #ifdef L_hsearch_r
@@ -135,7 +135,7 @@ void hdestroy_r (struct hsearch_data *htab)
    means used. The used field can be used as a first fast comparison for
    equality of the stored and the parameter value. This helps to prevent
    unnecessary expensive calls of strcmp.  */
-int hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
+int attribute_hidden __hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
 	       struct hsearch_data *htab)
 {
   unsigned int hval;
@@ -224,5 +224,5 @@ int hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
   *retval = NULL;
   return 0;
 }
-/* libc_hidden_def (hsearch_r) */
+strong_alias(__hsearch_r,hsearch_r)
 #endif

+ 2 - 1
libc/misc/search/tsearch.c

@@ -205,13 +205,14 @@ tdestroy_recurse (node *root, __free_fn_t freefct)
     free (root);
 }
 
-void tdestroy (void *vroot, __free_fn_t freefct)
+void attribute_hidden __tdestroy (void *vroot, __free_fn_t freefct)
 {
     node *root = (node *) vroot;
     if (root != NULL) {
 	tdestroy_recurse (root, freefct);
     }
 }
+strong_alias(__tdestroy,tdestroy)
 #endif
 
 /* tsearch.c ends here */

+ 25 - 17
libc/misc/syslog/syslog.c

@@ -31,6 +31,10 @@
  * SUCH DAMAGE.
  */
 
+#define time __time
+#define ctime __ctime
+#define sigaction __sigaction_internal
+
 #define __FORCE_GLIBC
 #define _GNU_SOURCE
 #include <features.h>
@@ -136,18 +140,8 @@ sigpipe_handler (int sig)
  * syslog, vsyslog --
  *     print message on log file; output is intended for syslogd(8).
  */
-void
-syslog(int pri, const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-	vsyslog(pri, fmt, ap);
-	va_end(ap);
-}
-
-void
-vsyslog( int pri, const char *fmt, va_list ap )
+void attribute_hidden
+__vsyslog( int pri, const char *fmt, va_list ap )
 {
 	register char *p;
 	char *last_chr, *head_end, *end, *stdp;
@@ -190,7 +184,7 @@ vsyslog( int pri, const char *fmt, va_list ap )
 			p += sprintf(p, "<BUFFER OVERRUN ATTEMPT>");
 	}
 	if (LogStat & LOG_PID)
-		p += sprintf(p, "[%d]", getpid());
+		p += sprintf(p, "[%d]", __getpid());
 	if (LogTag) {
 		*p++ = ':';
 		*p++ = ' ';
@@ -267,12 +261,24 @@ getout:
 		sigaction (SIGPIPE, &oldaction,
 			(struct sigaction *) NULL);
 }
+strong_alias(__vsyslog,vsyslog)
+
+void attribute_hidden
+__syslog(int pri, const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+	__vsyslog(pri, fmt, ap);
+	va_end(ap);
+}
+strong_alias(__syslog,syslog)
 
 /*
  * OPENLOG -- open system log
  */
-void
-openlog( const char *ident, int logstat, int logfac )
+void attribute_hidden
+__openlog( const char *ident, int logstat, int logfac )
 {
     int logType = SOCK_DGRAM;
 
@@ -319,15 +325,17 @@ retry:
 
     UNLOCK;
 }
+strong_alias(__openlog,openlog)
 
 /*
  * CLOSELOG -- close the system log
  */
-void
-closelog( void )
+void attribute_hidden
+__closelog( void )
 {
 	closelog_intern(1);
 }
+strong_alias(__closelog,closelog)
 
 /* setlogmask -- set the log mask level */
 int setlogmask(int pmask)

+ 2 - 2
libc/misc/sysvipc/shm.c

@@ -17,8 +17,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* SHMLBA is using it */
-#define __getpagesize __libc_getpagesize
+/* SHMLBA uses it */
+#define __getpagesize __getpagesize_internal
 
 #include <stdlib.h>
 #include <errno.h>

+ 2 - 1
libc/misc/time/adjtime.c

@@ -1,3 +1,5 @@
+#define adjtimex __adjtimex
+
 #include <limits.h>
 #include <sys/time.h>
 #include <sys/timex.h>
@@ -49,4 +51,3 @@ adjtime(const struct timeval * itv, struct timeval * otv)
   }
   return 0;
 }
-

+ 18 - 9
libc/misc/time/time.c

@@ -184,6 +184,11 @@
 
 extern struct tm __time_tm;
 
+extern struct tm *__localtime_r (__const time_t *__restrict __timer,
+			       struct tm *__restrict __tp) attribute_hidden;
+
+extern struct tm *__localtime (__const time_t *__timer) attribute_hidden;
+
 typedef struct {
 	long gmt_offset;
 	long dst_offset;
@@ -386,6 +391,8 @@ strong_alias(__asctime_r,asctime_r)
 /**********************************************************************/
 #ifdef L_clock
 
+#define times __times
+
 #include <sys/times.h>
 
 #ifndef __BCC__
@@ -452,12 +459,12 @@ clock_t clock(void)
 /**********************************************************************/
 #ifdef L_ctime
 
-char *ctime(const time_t *clock)
+char attribute_hidden *__ctime(const time_t *clock)
 {
 	/* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */
-	return __asctime(localtime(clock));
+	return __asctime(__localtime(clock));
 }
-
+strong_alias(__ctime,ctime)
 #endif
 /**********************************************************************/
 #ifdef L_ctime_r
@@ -466,7 +473,7 @@ char *ctime_r(const time_t *clock, char *buf)
 {
 	struct tm xtm;
 
-	return __asctime_r(localtime_r(clock, &xtm), buf);
+	return __asctime_r(__localtime_r(clock, &xtm), buf);
 }
 
 #endif
@@ -534,22 +541,23 @@ struct tm *gmtime_r(const time_t *__restrict timer,
 /**********************************************************************/
 #ifdef L_localtime
 
-struct tm *localtime(const time_t *timer)
+struct tm attribute_hidden *__localtime(const time_t *timer)
 {
 	register struct tm *ptm = &__time_tm;
 
 	/* In this implementation, tzset() is called by localtime_r().  */
 
-	localtime_r(timer, ptm);	/* Can return NULL... */
+	__localtime_r(timer, ptm);	/* Can return NULL... */
 
 	return ptm;
 }
+strong_alias(__localtime,localtime)
 
 #endif
 /**********************************************************************/
 #ifdef L_localtime_r
 
-struct tm *localtime_r(register const time_t *__restrict timer,
+struct tm attribute_hidden *__localtime_r(register const time_t *__restrict timer,
 					   register struct tm *__restrict result)
 {
 	TZLOCK;
@@ -562,6 +570,7 @@ struct tm *localtime_r(register const time_t *__restrict timer,
 
 	return result;
 }
+strong_alias(__localtime_r,localtime_r)
 
 #endif
 /**********************************************************************/
@@ -1542,7 +1551,7 @@ char *__XL(strptime)(const char *__restrict buf, const char *__restrict format,
 				buf = o;
 
 				if (!code) {	/* s */
-					localtime_r(&t, tm); /* TODO: check for failure? */
+					__localtime_r(&t, tm); /* TODO: check for failure? */
 					i = 0;
 					do {		/* Now copy values from tm to fields. */
 						 fields[i] = ((int *) tm)[i];
@@ -1806,7 +1815,7 @@ void tzset(void)
 
 	TZLOCK;
 
-	e = getenv(TZ);				/* TZ env var always takes precedence. */
+	e = __getenv(TZ);				/* TZ env var always takes precedence. */
 
 #if defined(__UCLIBC_HAS_TZ_FILE__) && !defined(__UCLIBC_HAS_TZ_FILE_READ_MANY__)
 	/* Put this inside the lock to prevent the possiblity of two different

+ 1 - 1
libc/misc/utmp/wtent.c

@@ -34,7 +34,7 @@ void logwtmp (const char *line, const char *name, const char *host)
     __memset (&(lutmp), 0, sizeof (struct utmp));
 
     lutmp.ut_type = (name && *name)? USER_PROCESS : DEAD_PROCESS;
-    lutmp.ut_pid = getpid();
+    lutmp.ut_pid = __getpid();
     __strncpy(lutmp.ut_line, line, sizeof(lutmp.ut_line)-1);
     __strncpy(lutmp.ut_name, name, sizeof(lutmp.ut_name)-1);
     __strncpy(lutmp.ut_host, host, sizeof(lutmp.ut_host)-1);

+ 7 - 4
libc/misc/wordexp/wordexp.c

@@ -20,9 +20,12 @@
    Boston, MA 02111-1307, USA.  */
 
 #define mempcpy __mempcpy
+#define stpcpy __stpcpy
 #define strndup __strndup
 #define strspn __strspn
 #define unsetenv __unsetenv
+#define waitpid __waitpid
+#define kill __kill
 
 #define _GNU_SOURCE
 #include <sys/cdefs.h>
@@ -283,7 +286,7 @@ parse_tilde(char **word, size_t * word_length, size_t * max_length,
 		   results are unspecified.  We do a lookup on the uid if
 		   HOME is unset. */
 
-		home = getenv("HOME");
+		home = __getenv("HOME");
 		if (home != NULL) {
 			*word = w_addstr(*word, word_length, max_length, home);
 			if (*word == NULL)
@@ -1328,7 +1331,7 @@ parse_param(char **word, size_t * word_length, size_t * max_length,
 		/* Is it `$$'? */
 		if (*env == '$') {
 			buffer[20] = '\0';
-			value = _itoa(getpid(), &buffer[20]);
+			value = _itoa(__getpid(), &buffer[20]);
 		}
 		/* Is it `${#*}' or `${#@}'? */
 		else if ((*env == '*' || *env == '@') && seen_hash) {
@@ -1395,7 +1398,7 @@ parse_param(char **word, size_t * word_length, size_t * max_length,
 			}
 		}
 	} else
-		value = getenv(env);
+		value = __getenv(env);
 
 	if (value == NULL && (flags & WRDE_UNDEF)) {
 		/* Variable not defined. */
@@ -2067,7 +2070,7 @@ int wordexp(const char *words, wordexp_t * we, int flags)
 	/* Find out what the field separators are.
 	 * There are two types: whitespace and non-whitespace.
 	 */
-	ifs = getenv("IFS");
+	ifs = __getenv("IFS");
 
 	if (!ifs)
 		/* IFS unset - use <space><tab><newline>. */

+ 3 - 0
libc/pwd_grp/lckpwdf.c

@@ -19,6 +19,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#define sigfillset __sigfillset_internal
+#define sigaction __sigaction_internal
+
 #include <features.h>
 #include <fcntl.h>
 #include <signal.h>

+ 2 - 0
libc/signal/killpg.c

@@ -16,6 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define kill __kill
+
 #include <errno.h>
 #include <signal.h>
 

+ 4 - 1
libc/signal/raise.c

@@ -2,6 +2,9 @@
  * This file is part of the Linux-8086 C library and is distributed
  * under the GNU Library General Public License.
  */
+
+#define kill __kill
+
 #include <unistd.h>
 #include <string.h>
 #include <signal.h>
@@ -10,7 +13,7 @@
 #undef raise
 int attribute_hidden __raise(int signo)
 {
-    return kill(getpid(), signo);
+    return kill(__getpid(), signo);
 }
 
 /* psm: keep this weak, because the one in libpthread.so could overwrite it */

+ 7 - 14
libc/signal/sigaction.c

@@ -28,17 +28,12 @@
    translate it here.  */
 #include <bits/kernel_sigaction.h>
 
-int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
-
 #if defined __NR_rt_sigaction
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int
-__libc_sigaction (sig, act, oact)
-     int sig;
-     const struct sigaction *act;
-     struct sigaction *oact;
+int attribute_hidden
+__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 	int result;
 	struct kernel_sigaction kact, koact;
@@ -74,11 +69,8 @@ __libc_sigaction (sig, act, oact)
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int
-__libc_sigaction (sig, act, oact)
-     int sig;
-     const struct sigaction *act;
-     struct sigaction *oact;
+int attribute_hidden
+__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 	int result;
 	struct old_kernel_sigaction kact, koact;
@@ -110,5 +102,6 @@ __libc_sigaction (sig, act, oact)
 
 #endif
 
-weak_alias (__libc_sigaction, __sigaction)
-weak_alias (__libc_sigaction, sigaction)
+strong_alias(__sigaction_internal,__libc_sigaction)
+weak_alias(__sigaction_internal,__sigaction)
+weak_alias(__sigaction_internal,sigaction)

+ 3 - 4
libc/signal/sigdelset.c

@@ -19,10 +19,8 @@
 #include "sigsetops.h"
 
 /* Add SIGNO to SET.  */
-int
-sigdelset (set, signo)
-     sigset_t *set;
-     int signo;
+int attribute_hidden
+__sigdelset_internal (sigset_t *set, int signo)
 {
   if (set == NULL || signo <= 0 || signo >= NSIG)
     {
@@ -32,3 +30,4 @@ sigdelset (set, signo)
 
   return __sigdelset (set, signo);
 }
+strong_alias(__sigdelset_internal,sigdelset)

+ 3 - 3
libc/signal/sigfillset.c

@@ -21,9 +21,8 @@
 #include <string.h>
 
 /* Set all signals in SET.  */
-int
-sigfillset (set)
-     sigset_t *set;
+int attribute_hidden
+__sigfillset_internal (sigset_t *set)
 {
   if (set == NULL)
     {
@@ -44,3 +43,4 @@ sigfillset (set)
 
   return 0;
 }
+strong_alias(__sigfillset_internal,sigfillset)

+ 2 - 0
libc/signal/sigignore.c

@@ -18,6 +18,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigaction __sigaction_internal
+
 #define _GNU_SOURCE
 #include <errno.h>
 #define __need_NULL

+ 2 - 0
libc/signal/sigintr.c

@@ -16,6 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigaction __sigaction_internal
+
 #include <stddef.h>
 #include <signal.h>
 #include <errno.h>

+ 2 - 0
libc/signal/signal.c

@@ -18,6 +18,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigaction __sigaction_internal
+
 #include <errno.h>
 #include <signal.h>
 #include <string.h>	/* For the real memset prototype.  */

+ 2 - 0
libc/signal/sigpause.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigdelset __sigdelset_internal
+
 #include <errno.h>
 #include <signal.h>
 #include <stddef.h>		/* For NULL.  */

+ 2 - 0
libc/signal/sigrelse.c

@@ -18,6 +18,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigdelset __sigdelset_internal
+
 #define __need_NULL
 #include <stddef.h>
 #define _GNU_SOURCE

+ 2 - 0
libc/signal/sigset.c

@@ -16,6 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigaction __sigaction_internal
+
 #include <errno.h>
 #define __need_NULL
 #include <stddef.h>

+ 2 - 0
libc/signal/sysv_signal.c

@@ -16,6 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define sigaction __sigaction_internal
+
 #include <errno.h>
 #include <signal.h>
 #include <string.h>	/* For the real memset prototype.  */

+ 2 - 3
libc/stdio/getdelim.c

@@ -20,7 +20,7 @@
 
 #define GETDELIM_GROWBY		64
 
-ssize_t attribute_hidden __libc_getdelim(char **__restrict lineptr, size_t *__restrict n,
+ssize_t attribute_hidden __getdelim(char **__restrict lineptr, size_t *__restrict n,
 				   int delimiter, register FILE *__restrict stream)
 {
 	register char *buf;
@@ -74,5 +74,4 @@ ssize_t attribute_hidden __libc_getdelim(char **__restrict lineptr, size_t *__re
 	return pos;
 }
 
-strong_alias(__libc_getdelim,__getdelim)
-weak_alias(__getdelim,getdelim)
+strong_alias(__getdelim,getdelim)

+ 4 - 3
libc/stdio/getline.c

@@ -5,12 +5,13 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
-#define __getdelim __libc_getdelim
+#define getdelim __getdelim
 
 #include "_stdio.h"
 
-ssize_t getline(char **__restrict lineptr, size_t *__restrict n,
+ssize_t attribute_hidden __getline(char **__restrict lineptr, size_t *__restrict n,
 				FILE *__restrict stream)
 {
-	return __getdelim(lineptr, n, '\n', stream);
+	return getdelim(lineptr, n, '\n', stream);
 }
+strong_alias(__getline,getline)

+ 2 - 1
libc/stdio/open_memstream.c

@@ -124,7 +124,7 @@ static const cookie_io_functions_t _oms_io_funcs = {
  * (ie replace the FILE buffer with the cookie buffer and update FILE bufstart,
  * etc. whenever we seek). */
 
-FILE *open_memstream(char **__restrict bufloc, size_t *__restrict sizeloc)
+FILE attribute_hidden *__open_memstream(char **__restrict bufloc, size_t *__restrict sizeloc)
 {
 	register __oms_cookie *cookie;
 	register FILE *fp;
@@ -160,3 +160,4 @@ FILE *open_memstream(char **__restrict bufloc, size_t *__restrict sizeloc)
 
 	return NULL;
 }
+strong_alias(__open_memstream,open_memstream)

+ 1 - 0
libc/stdio/popen.c

@@ -14,6 +14,7 @@
  *   Fix failure exit code for failed execve().
  */
 
+#define waitpid __waitpid
 
 #include <stdio.h>
 #include <stdlib.h>

+ 2 - 0
libc/stdio/vasprintf.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
 
+#define open_memstream __open_memstream
+
 #include "_stdio.h"
 #include <stdarg.h>
 #include <bits/uClibc_va_copy.h>

+ 2 - 0
libc/stdlib/abort.c

@@ -18,6 +18,8 @@ Cambridge, MA 02139, USA.  */
 
 /* Hacked up for uClibc by Erik Andersen */
 
+#define sigaction __sigaction_internal
+
 #define _GNU_SOURCE
 #include <features.h>
 #include <signal.h>

+ 2 - 0
libc/stdlib/drand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define erand48_r __erand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 0
libc/stdlib/drand48_r.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define erand48_r __erand48_r
+
 #include <errno.h>
 #include <math.h>
 #include <stdlib.h>

+ 1 - 0
libc/stdlib/erand48.c

@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define erand48_r __erand48_r
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 5
libc/stdlib/erand48_r.c

@@ -24,11 +24,7 @@
 extern int __drand48_iterate(unsigned short xsubi[3], 
 	struct drand48_data *buffer) attribute_hidden;
 
-
-int erand48_r (xsubi, buffer, result)
-     unsigned short int xsubi[3];
-     struct drand48_data *buffer;
-     double *result;
+int attribute_hidden __erand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, double *result)
 {
     union ieee754_double temp;
 
@@ -49,3 +45,4 @@ int erand48_r (xsubi, buffer, result)
 
     return 0;
 }
+strong_alias(__erand48_r,erand48_r)

+ 2 - 1
libc/stdlib/getenv.c

@@ -22,7 +22,7 @@
 
 /* IEEE Std 1003.1-2001 says getenv need not be thread safe, so 
  * don't bother locking access to __environ */
-char *getenv(const char *var)
+char attribute_hidden *__getenv(const char *var)
 {
     int len;
     char **ep;
@@ -39,3 +39,4 @@ char *getenv(const char *var)
     return NULL;
 }
 
+strong_alias(__getenv,getenv)

+ 2 - 0
libc/stdlib/jrand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define jrand48_r __jrand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 4
libc/stdlib/jrand48_r.c

@@ -22,10 +22,7 @@
 extern int __drand48_iterate(unsigned short xsubi[3], 
 	struct drand48_data *buffer) attribute_hidden;
 
-int jrand48_r (xsubi, buffer, result)
-     unsigned short int xsubi[3];
-     struct drand48_data *buffer;
-     long int *result;
+int attribute_hidden __jrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
 {
     /* Compute next state.  */
     if (__drand48_iterate (xsubi, buffer) < 0)
@@ -36,3 +33,4 @@ int jrand48_r (xsubi, buffer, result)
 
     return 0;
 }
+strong_alias(__jrand48_r,jrand48_r)

+ 2 - 0
libc/stdlib/lrand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define nrand48_r __nrand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 4 - 1
libc/stdlib/lrand48_r.c

@@ -17,9 +17,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define nrand48_r __nrand48_r
+
 #include <stdlib.h>
 
-int lrand48_r (struct drand48_data *buffer, long int *result)
+int attribute_hidden __lrand48_r (struct drand48_data *buffer, long int *result)
 {
     /* Be generous for the arguments, detect some errors.  */
     if (buffer == NULL)
@@ -27,3 +29,4 @@ int lrand48_r (struct drand48_data *buffer, long int *result)
 
     return nrand48_r (buffer->__x, buffer, result);
 }
+strong_alias(__lrand48_r,lrand48_r)

+ 1 - 1
libc/stdlib/malloc/malloc_debug.c

@@ -55,7 +55,7 @@ __malloc_debug_printf (int indent, const char *fmt, ...)
 void
 __malloc_debug_init (void)
 {
-  char *ev = getenv ("MALLOC_DEBUG");
+  char *ev = __getenv ("MALLOC_DEBUG");
   if (ev)
     {
       int val = atoi (ev);

+ 2 - 0
libc/stdlib/mrand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define jrand48_r __jrand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 0
libc/stdlib/mrand48_r.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define jrand48_r __jrand48_r
+
 #include <stdlib.h>
 
 int mrand48_r (struct drand48_data *buffer, long int *result)

+ 2 - 0
libc/stdlib/nrand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define nrand48_r __nrand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 4
libc/stdlib/nrand48_r.c

@@ -22,10 +22,7 @@
 extern int __drand48_iterate(unsigned short xsubi[3], 
 	struct drand48_data *buffer) attribute_hidden;
 
-int nrand48_r (xsubi, buffer, result)
-     unsigned short int xsubi[3];
-     struct drand48_data *buffer;
-     long int *result;
+int attribute_hidden __nrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer, long int *result)
 {
     /* Compute next state.  */
     if (__drand48_iterate (xsubi, buffer) < 0)
@@ -39,3 +36,4 @@ int nrand48_r (xsubi, buffer, result)
 
     return 0;
 }
+strong_alias(__nrand48_r,nrand48_r)

+ 2 - 0
libc/stdlib/srand48.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define srand48_r __srand48_r
+
 #include <stdlib.h>
 
 /* Global state for non-reentrant functions.  Defined in drand48-iter.c.  */

+ 2 - 3
libc/stdlib/srand48_r.c

@@ -20,9 +20,7 @@
 #include <stdlib.h>
 #include <limits.h>
 
-int srand48_r (seedval, buffer)
-     long int seedval;
-     struct drand48_data *buffer;
+int attribute_hidden __srand48_r (long int seedval, struct drand48_data *buffer)
 {
     /* The standards say we only have 32 bits.  */
     if (sizeof (long int) > 4)
@@ -38,3 +36,4 @@ int srand48_r (seedval, buffer)
 
     return 0;
 }
+strong_alias(__srand48_r,srand48_r)

+ 2 - 0
libc/stdlib/system.c

@@ -1,3 +1,5 @@
+#define wait4 __wait4
+
 #include <stdio.h>
 #include <stddef.h>
 #include <signal.h>

+ 1 - 0
libc/stdlib/unix_grantpt.c

@@ -20,6 +20,7 @@
 #define memchr __memchr
 #define getgid __getgid
 #define setrlimit __setrlimit
+#define waitpid __waitpid
 
 #include <assert.h>
 #include <errno.h>

+ 1 - 1
libc/stdlib/valloc.c

@@ -20,7 +20,7 @@ Cambridge, MA 02139, USA.
    The author may be reached (Email) at the address mike@@ai.mit.edu,
    or (US mail) as Mike Haertel c/o Free Software Foundation.  */
 
-#define getpagesize __libc_getpagesize
+#define getpagesize __getpagesize_internal
 
 #include <stdlib.h>
 #include <unistd.h>

+ 1 - 1
libc/string/generic/mempcpy.c

@@ -9,7 +9,7 @@
 
 #undef mempcpy
 
-void *__mempcpy (void *dstpp, const void *srcpp, size_t len)
+void attribute_hidden *__mempcpy (void *dstpp, const void *srcpp, size_t len)
 {
   __memcpy(dstpp, srcpp, len);
   return (void *)(((char *)dstpp) + len);

+ 4 - 3
libc/sysdeps/linux/arm/sigaction.c

@@ -46,7 +46,7 @@ extern void __default_rt_sa_restorer(void);
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
 {
     int result;
     struct kernel_sigaction kact, koact;
@@ -94,7 +94,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+int __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
 {
     int result;
     struct old_kernel_sigaction kact, koact;
@@ -127,5 +127,6 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
 }
 
 #endif
-weak_alias(__libc_sigaction, sigaction)
+strong_alias(__sigaction_internal,__libc_sigaction)
+weak_alias(__sigaction_internal, sigaction)
 

+ 1 - 1
libc/sysdeps/linux/common/__rt_sigtimedwait.c

@@ -13,7 +13,7 @@
 #include <stddef.h>
 #ifdef __NR_rt_sigtimedwait
 #define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
-_syscall4(int, __rt_sigtimedwait, const sigset_t *, set, siginfo_t *, info,
+static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set, siginfo_t *, info,
 		  const struct timespec *, timeout, size_t, setsize);
 
 int sigwaitinfo(const sigset_t * set, siginfo_t * info)

+ 1 - 1
libc/sysdeps/linux/common/__syscall_rt_sigaction.c

@@ -14,7 +14,7 @@
 
 #define __NR___syscall_rt_sigaction __NR_rt_sigaction
 #undef sigaction
-_syscall4(int, __syscall_rt_sigaction, int, signum,
+attribute_hidden _syscall4(int, __syscall_rt_sigaction, int, signum,
 		  const struct sigaction *, act, struct sigaction *, oldact,
 		  size_t, size);
 

+ 1 - 1
libc/sysdeps/linux/common/__syscall_sigaction.c

@@ -13,7 +13,7 @@
 #define __NR___syscall_sigaction __NR_sigaction
 #include <signal.h>
 #undef sigaction
-_syscall3(int, __syscall_sigaction, int, signum, const struct sigaction *,
+attribute_hidden _syscall3(int, __syscall_sigaction, int, signum, const struct sigaction *,
 		  act, struct sigaction *, oldact);
 #endif
 

+ 5 - 3
libc/sysdeps/linux/common/adjtimex.c

@@ -9,7 +9,9 @@
 
 #include "syscalls.h"
 #include <sys/timex.h>
-_syscall1(int, adjtimex, struct timex *, buf);
 
-weak_alias(adjtimex, __adjtimex);
-weak_alias(adjtimex, ntp_adjtime);
+#define __NR___adjtimex __NR_adjtimex
+attribute_hidden _syscall1(int, __adjtimex, struct timex *, buf);
+
+strong_alias(__adjtimex, adjtimex)
+weak_alias(__adjtimex, ntp_adjtime)

+ 2 - 0
libc/sysdeps/linux/common/alarm.c

@@ -7,6 +7,8 @@
  * GNU Library General Public License (LGPL) version 2 or later.
  */
 
+#define setitimer __setitimer
+
 #include "syscalls.h"
 #include <unistd.h>
 #ifdef __NR_alarm

+ 2 - 0
libc/sysdeps/linux/common/clock_settime.c

@@ -19,6 +19,8 @@
  *
  */
 
+#define settimeofday __settimeofday
+
 #define _GNU_SOURCE
 #include "syscalls.h"
 #include <time.h>

+ 1 - 1
libc/sysdeps/linux/common/getdirname.c

@@ -37,7 +37,7 @@ get_current_dir_name (void)
 	struct stat dotstat, pwdstat;
 #endif
 
-	pwd = getenv ("PWD");
+	pwd = __getenv ("PWD");
 	if (pwd != NULL
 #if defined __UCLIBC_HAS_LFS__
 		&& stat64 (".", &dotstat) == 0

+ 2 - 2
libc/sysdeps/linux/common/getdtablesize.c

@@ -27,7 +27,7 @@
 
 /* Return the maximum number of file descriptors
    the current process could possibly have.  */
-int getdtablesize (void)
+int attribute_hidden __getdtablesize (void)
 {
   struct rlimit ru;
 
@@ -36,4 +36,4 @@ int getdtablesize (void)
      returns -1.  */
   return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur;
 }
-
+strong_alias(__getdtablesize,getdtablesize)

+ 4 - 3
libc/sysdeps/linux/common/getpagesize.c

@@ -22,7 +22,8 @@
 extern size_t __pagesize;
 
 /* Return the system page size.  */
-int attribute_hidden __libc_getpagesize(void)
+/* couldn't make __getpagesize hidden, because shm.h uses it in a macro */
+int attribute_hidden __getpagesize_internal(void)
 {
   if (__pagesize != 0)
     return __pagesize;
@@ -40,6 +41,6 @@ int attribute_hidden __libc_getpagesize(void)
 #endif	/* NBPG.  */
 #endif	/* EXEC_PAGESIZE.  */
 }
-strong_alias(__libc_getpagesize, __getpagesize)
-weak_alias(__getpagesize, getpagesize)
+strong_alias(__getpagesize_internal, __getpagesize)
+weak_alias(__getpagesize_internal, getpagesize)
 

+ 6 - 5
libc/sysdeps/linux/common/getpid.c

@@ -11,9 +11,10 @@
 #include <unistd.h>
 
 #if defined (__alpha__)
-#define __NR_getpid     __NR_getxpid
+#define __NR___getpid __NR_getxpid
 #endif
-#define __NR___libc_getpid __NR_getpid
-_syscall0(pid_t, __libc_getpid);
-weak_alias(__libc_getpid, getpid);
-weak_alias(__libc_getpid, __getpid);
+#define __NR___getpid __NR_getpid
+attribute_hidden _syscall0(pid_t, __getpid);
+strong_alias(__getpid, getpid)
+/* not used in libpthread */
+/* weak_alias(__getpid, __libc_getpid) */

+ 1 - 1
libc/sysdeps/linux/common/getppid.c

@@ -14,6 +14,6 @@ _syscall0(pid_t, getppid);
 #	else
 pid_t getppid(void)
 {
-	return (getpid());
+	return (__getpid());
 }
 #	endif

+ 2 - 1
libc/sysdeps/linux/common/kill.c

@@ -14,7 +14,8 @@
 #define __NR___syscall_kill __NR_kill
 static inline _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig);
 
-int kill(pid_t pid, int sig)
+int attribute_hidden __kill(pid_t pid, int sig)
 {
 	return (__syscall_kill(pid, sig));
 }
+strong_alias(__kill,kill)

+ 2 - 0
libc/sysdeps/linux/common/ntp_gettime.c

@@ -16,6 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define adjtimex __adjtimex
+
 #include <sys/timex.h>
 
 int ntp_gettime(struct ntptimeval *ntv)

+ 2 - 0
libc/sysdeps/linux/common/poll.c

@@ -17,6 +17,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define getdtablesize __getdtablesize
+
 #include "syscalls.h"
 #include <sys/poll.h>
 

+ 3 - 1
libc/sysdeps/linux/common/setitimer.c

@@ -9,5 +9,7 @@
 
 #include "syscalls.h"
 #include <sys/time.h>
-_syscall3(int, setitimer, __itimer_which_t, which,
+#define __NR___setitimer __NR_setitimer
+attribute_hidden _syscall3(int, __setitimer, __itimer_which_t, which,
 		  const struct itimerval *, new, struct itimerval *, old);
+strong_alias(__setitimer,setitimer)

+ 3 - 1
libc/sysdeps/linux/common/settimeofday.c

@@ -9,5 +9,7 @@
 
 #include "syscalls.h"
 #include <sys/time.h>
-_syscall2(int, settimeofday, const struct timeval *, tv,
+#define __NR___settimeofday __NR_settimeofday
+attribute_hidden _syscall2(int, __settimeofday, const struct timeval *, tv,
 		  const struct timezone *, tz);
+strong_alias(__settimeofday,settimeofday)

Some files were not shown because too many files changed in this diff