summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/getaddrinfo.c6
-rw-r--r--libc/inet/getnetbyad.c4
-rw-r--r--libc/inet/getnetbynm.c4
-rw-r--r--libc/inet/getnetent.c10
-rw-r--r--libc/inet/getservice.c85
-rw-r--r--libc/inet/resolv.c1
-rw-r--r--libc/inet/rpc/auth_none.c2
-rw-r--r--libc/inet/rpc/auth_unix.c1
-rw-r--r--libc/inet/rpc/bindresvport.c2
-rw-r--r--libc/inet/rpc/clnt_raw.c1
-rw-r--r--libc/inet/rpc/clnt_tcp.c1
-rw-r--r--libc/inet/rpc/clnt_udp.c1
-rw-r--r--libc/inet/rpc/clnt_unix.c3
-rw-r--r--libc/inet/rpc/create_xid.c3
-rw-r--r--libc/inet/rpc/pmap_clnt.c5
-rw-r--r--libc/inet/rpc/pmap_rmt.c1
-rw-r--r--libc/inet/rpc/rcmd.c3
-rw-r--r--libc/inet/rpc/rpc_dtablesize.c2
-rw-r--r--libc/inet/rpc/ruserpass.c2
-rw-r--r--libc/inet/rpc/svc.c2
-rw-r--r--libc/inet/rpc/svc_auth_unix.c2
-rw-r--r--libc/inet/rpc/svc_raw.c2
-rw-r--r--libc/inet/rpc/svc_udp.c1
-rw-r--r--libc/inet/rpc/svc_unix.c2
-rw-r--r--libc/inet/rpc/xdr_mem.c5
-rw-r--r--libc/misc/file/lockf.c2
-rw-r--r--libc/misc/file/lockf64.c2
-rw-r--r--libc/misc/ftw/ftw.c2
-rw-r--r--libc/misc/internals/tempname.c2
-rw-r--r--libc/misc/locale/locale.c3
-rw-r--r--libc/misc/regex/regex.c4
-rw-r--r--libc/misc/search/hsearch.c4
-rw-r--r--libc/misc/search/hsearch_r.c12
-rw-r--r--libc/misc/search/tsearch.c3
-rw-r--r--libc/misc/syslog/syslog.c42
-rw-r--r--libc/misc/sysvipc/shm.c4
-rw-r--r--libc/misc/time/adjtime.c3
-rw-r--r--libc/misc/time/time.c27
-rw-r--r--libc/misc/utmp/wtent.c2
-rw-r--r--libc/misc/wordexp/wordexp.c11
-rw-r--r--libc/pwd_grp/lckpwdf.c3
-rw-r--r--libc/signal/killpg.c2
-rw-r--r--libc/signal/raise.c5
-rw-r--r--libc/signal/sigaction.c21
-rw-r--r--libc/signal/sigdelset.c7
-rw-r--r--libc/signal/sigfillset.c6
-rw-r--r--libc/signal/sigignore.c2
-rw-r--r--libc/signal/sigintr.c2
-rw-r--r--libc/signal/signal.c2
-rw-r--r--libc/signal/sigpause.c2
-rw-r--r--libc/signal/sigrelse.c2
-rw-r--r--libc/signal/sigset.c2
-rw-r--r--libc/signal/sysv_signal.c2
-rw-r--r--libc/stdio/getdelim.c5
-rw-r--r--libc/stdio/getline.c7
-rw-r--r--libc/stdio/open_memstream.c3
-rw-r--r--libc/stdio/popen.c1
-rw-r--r--libc/stdio/vasprintf.c2
-rw-r--r--libc/stdlib/abort.c2
-rw-r--r--libc/stdlib/drand48.c2
-rw-r--r--libc/stdlib/drand48_r.c2
-rw-r--r--libc/stdlib/erand48.c1
-rw-r--r--libc/stdlib/erand48_r.c7
-rw-r--r--libc/stdlib/getenv.c3
-rw-r--r--libc/stdlib/jrand48.c2
-rw-r--r--libc/stdlib/jrand48_r.c6
-rw-r--r--libc/stdlib/lrand48.c2
-rw-r--r--libc/stdlib/lrand48_r.c5
-rw-r--r--libc/stdlib/malloc/malloc_debug.c2
-rw-r--r--libc/stdlib/mrand48.c2
-rw-r--r--libc/stdlib/mrand48_r.c2
-rw-r--r--libc/stdlib/nrand48.c2
-rw-r--r--libc/stdlib/nrand48_r.c6
-rw-r--r--libc/stdlib/srand48.c2
-rw-r--r--libc/stdlib/srand48_r.c5
-rw-r--r--libc/stdlib/system.c2
-rw-r--r--libc/stdlib/unix_grantpt.c1
-rw-r--r--libc/stdlib/valloc.c2
-rw-r--r--libc/string/generic/mempcpy.c2
-rw-r--r--libc/sysdeps/linux/arm/sigaction.c7
-rw-r--r--libc/sysdeps/linux/common/__rt_sigtimedwait.c2
-rw-r--r--libc/sysdeps/linux/common/__syscall_rt_sigaction.c2
-rw-r--r--libc/sysdeps/linux/common/__syscall_sigaction.c2
-rw-r--r--libc/sysdeps/linux/common/adjtimex.c8
-rw-r--r--libc/sysdeps/linux/common/alarm.c2
-rw-r--r--libc/sysdeps/linux/common/clock_settime.c2
-rw-r--r--libc/sysdeps/linux/common/getdirname.c2
-rw-r--r--libc/sysdeps/linux/common/getdtablesize.c4
-rw-r--r--libc/sysdeps/linux/common/getpagesize.c7
-rw-r--r--libc/sysdeps/linux/common/getpid.c11
-rw-r--r--libc/sysdeps/linux/common/getppid.c2
-rw-r--r--libc/sysdeps/linux/common/kill.c3
-rw-r--r--libc/sysdeps/linux/common/ntp_gettime.c2
-rw-r--r--libc/sysdeps/linux/common/poll.c2
-rw-r--r--libc/sysdeps/linux/common/setitimer.c4
-rw-r--r--libc/sysdeps/linux/common/settimeofday.c4
-rw-r--r--libc/sysdeps/linux/common/ssp.c35
-rw-r--r--libc/sysdeps/linux/common/stime.c2
-rw-r--r--libc/sysdeps/linux/common/time.c6
-rw-r--r--libc/sysdeps/linux/common/times.c4
-rw-r--r--libc/sysdeps/linux/common/utime.c8
-rw-r--r--libc/sysdeps/linux/common/utimes.c8
-rw-r--r--libc/sysdeps/linux/common/wait.c8
-rw-r--r--libc/sysdeps/linux/common/wait3.c2
-rw-r--r--libc/sysdeps/linux/common/wait4.c3
-rw-r--r--libc/sysdeps/linux/common/waitpid.c9
-rw-r--r--libc/sysdeps/linux/i386/sigaction.c8
-rw-r--r--libc/sysdeps/linux/mips/sigaction.c7
-rw-r--r--libc/sysdeps/linux/x86_64/sigaction.c14
-rw-r--r--libc/unistd/exec.c2
-rw-r--r--libc/unistd/getlogin.c9
-rw-r--r--libc/unistd/getopt.c2
-rw-r--r--libc/unistd/sleep.c2
-rw-r--r--libc/unistd/sysconf.c3
-rw-r--r--libc/unistd/ualarm.c2
115 files changed, 393 insertions, 217 deletions
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index d2d0e151e..c467fed69 100644
--- a/libc/inet/getaddrinfo.c
+++ b/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
diff --git a/libc/inet/getnetbyad.c b/libc/inet/getnetbyad.c
index 0776ed7cf..a257a1bd7 100644
--- a/libc/inet/getnetbyad.c
+++ b/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>
diff --git a/libc/inet/getnetbynm.c b/libc/inet/getnetbynm.c
index 5479c654b..f4e9b817e 100644
--- a/libc/inet/getnetbynm.c
+++ b/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>
diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c
index 181c5adfe..fc21dfa03 100644
--- a/libc/inet/getnetent.c
+++ b/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)
diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c
index d5402ba3e..e4422246b 100644
--- a/libc/inet/getservice.c
+++ b/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)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 3313bfc85..18d186170 100644
--- a/libc/inet/resolv.c
+++ b/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>
diff --git a/libc/inet/rpc/auth_none.c b/libc/inet/rpc/auth_none.c
index e7b7aba53..9d1d42d03 100644
--- a/libc/inet/rpc/auth_none.c
+++ b/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"
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c
index c02cc309b..0ae5fe6a9 100644
--- a/libc/inet/rpc/auth_unix.c
+++ b/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>
diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c
index 98ce691ee..1fb80d701 100644
--- a/libc/inet/rpc/bindresvport.c
+++ b/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);
diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c
index e21f40252..41143496a 100644
--- a/libc/inet/rpc/clnt_raw.c
+++ b/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>
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index ad2797a9e..11f790529 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/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>
diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c
index 5a7e35e80..bc032f205 100644
--- a/libc/inet/rpc/clnt_udp.c
+++ b/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>
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index 93ea42afd..7372e51b9 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/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 ();
diff --git a/libc/inet/rpc/create_xid.c b/libc/inet/rpc/create_xid.c
index 8a6dacad3..3ef1850dd 100644
--- a/libc/inet/rpc/create_xid.c
+++ b/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>
diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c
index 5bbc81564..39d846f3b 100644
--- a/libc/inet/rpc/pmap_clnt.c
+++ b/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.
diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c
index db875e987..5a78ba2c9 100644
--- a/libc/inet/rpc/pmap_rmt.c
+++ b/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
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index a51d09fcd..e050480ce 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/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;
diff --git a/libc/inet/rpc/rpc_dtablesize.c b/libc/inet/rpc/rpc_dtablesize.c
index b520b1b48..aa6d598ce 100644
--- a/libc/inet/rpc/rpc_dtablesize.c
+++ b/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>
diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c
index 116a34276..ca040ada2 100644
--- a/libc/inet/rpc/ruserpass.c
+++ b/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. */
diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c
index a32c68bbc..5610277ee 100644
--- a/libc/inet/rpc/svc.c
+++ b/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
diff --git a/libc/inet/rpc/svc_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c
index 256a42154..c84c42725 100644
--- a/libc/inet/rpc/svc_auth_unix.c
+++ b/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>
diff --git a/libc/inet/rpc/svc_raw.c b/libc/inet/rpc/svc_raw.c
index 05bf3109c..b55f0864f 100644
--- a/libc/inet/rpc/svc_raw.c
+++ b/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"
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index a37552a4b..ab6f96ee1 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/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
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index d1568e4a7..5d3025876 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/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 ();
diff --git a/libc/inet/rpc/xdr_mem.c b/libc/inet/rpc/xdr_mem.c
index 568d0e54a..56908c434 100644
--- a/libc/inet/rpc/xdr_mem.c
+++ b/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
diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c
index 0962031da..29c91482a 100644
--- a/libc/misc/file/lockf.c
+++ b/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;
diff --git a/libc/misc/file/lockf64.c b/libc/misc/file/lockf64.c
index eb70e8ddd..63c2ddfbe 100644
--- a/libc/misc/file/lockf64.c
+++ b/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;
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index c36ae45b6..58a9c3177 100644
--- a/libc/misc/ftw/ftw.c
+++ b/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>
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index 360c76879..99a8ac0d8 100644
--- a/libc/misc/internals/tempname.c
+++ b/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) {
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index 77d3f1e5d..b73ffa3dd 100644
--- a/libc/misc/locale/locale.c
+++ b/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? */
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index d367211c5..bf8958a66 100644
--- a/libc/misc/regex/regex.c
+++ b/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. */
diff --git a/libc/misc/search/hsearch.c b/libc/misc/search/hsearch.c
index 067e4973b..a9400f3ca 100644
--- a/libc/misc/search/hsearch.c
+++ b/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
diff --git a/libc/misc/search/hsearch_r.c b/libc/misc/search/hsearch_r.c
index 0f96180b1..d297b3280 100644
--- a/libc/misc/search/hsearch_r.c
+++ b/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
diff --git a/libc/misc/search/tsearch.c b/libc/misc/search/tsearch.c
index 1da6b571e..93a2c678f 100644
--- a/libc/misc/search/tsearch.c
+++ b/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 */
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 69ff0b38b..e05297770 100644
--- a/libc/misc/syslog/syslog.c
+++ b/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)
diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c
index 9c6f019bf..20e28d3b1 100644
--- a/libc/misc/sysvipc/shm.c
+++ b/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>
diff --git a/libc/misc/time/adjtime.c b/libc/misc/time/adjtime.c
index 2049bc896..fd33ff60d 100644
--- a/libc/misc/time/adjtime.c
+++ b/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;
}
-
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 4d3c43492..3c47cb879 100644
--- a/libc/misc/time/time.c
+++ b/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
diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c
index bb5244878..0900ef379 100644
--- a/libc/misc/utmp/wtent.c
+++ b/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);
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index 5e9133c83..ea69bc684 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/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>. */
diff --git a/libc/pwd_grp/lckpwdf.c b/libc/pwd_grp/lckpwdf.c
index bac807e6f..9c0b75297 100644
--- a/libc/pwd_grp/lckpwdf.c
+++ b/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>
diff --git a/libc/signal/killpg.c b/libc/signal/killpg.c
index 1fcf6bfa5..91a332af6 100644
--- a/libc/signal/killpg.c
+++ b/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>
diff --git a/libc/signal/raise.c b/libc/signal/raise.c
index 69b61385c..5a964c4b6 100644
--- a/libc/signal/raise.c
+++ b/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 */
diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c
index 5a56ed1e6..0976e827c 100644
--- a/libc/signal/sigaction.c
+++ b/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)
diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c
index 16bc9ea4a..ea36b6c3c 100644
--- a/libc/signal/sigdelset.c
+++ b/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)
diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
index f06334216..84862cfa2 100644
--- a/libc/signal/sigfillset.c
+++ b/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)
diff --git a/libc/signal/sigignore.c b/libc/signal/sigignore.c
index 407b52e2a..490cc3814 100644
--- a/libc/signal/sigignore.c
+++ b/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
diff --git a/libc/signal/sigintr.c b/libc/signal/sigintr.c
index 8315c3a6b..c55d58618 100644
--- a/libc/signal/sigintr.c
+++ b/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>
diff --git a/libc/signal/signal.c b/libc/signal/signal.c
index 7df88eff0..f8355258a 100644
--- a/libc/signal/signal.c
+++ b/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. */
diff --git a/libc/signal/sigpause.c b/libc/signal/sigpause.c
index 35d58c680..fc77c958d 100644
--- a/libc/signal/sigpause.c
+++ b/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. */
diff --git a/libc/signal/sigrelse.c b/libc/signal/sigrelse.c
index 5519480e1..e2fa775bd 100644
--- a/libc/signal/sigrelse.c
+++ b/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
diff --git a/libc/signal/sigset.c b/libc/signal/sigset.c
index 350e3cb2d..7860669b6 100644
--- a/libc/signal/sigset.c
+++ b/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>
diff --git a/libc/signal/sysv_signal.c b/libc/signal/sysv_signal.c
index 576fc0b8d..78c9696dd 100644
--- a/libc/signal/sysv_signal.c
+++ b/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. */
diff --git a/libc/stdio/getdelim.c b/libc/stdio/getdelim.c
index f21b16062..e1b808340 100644
--- a/libc/stdio/getdelim.c
+++ b/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)
diff --git a/libc/stdio/getline.c b/libc/stdio/getline.c
index 7424dc024..943526abe 100644
--- a/libc/stdio/getline.c
+++ b/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)
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c
index 358486010..5799005d9 100644
--- a/libc/stdio/open_memstream.c
+++ b/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)
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index 6de09253c..45ac6f17f 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -14,6 +14,7 @@
* Fix failure exit code for failed execve().
*/
+#define waitpid __waitpid
#include <stdio.h>
#include <stdlib.h>
diff --git a/libc/stdio/vasprintf.c b/libc/stdio/vasprintf.c
index 688ab7cd5..512317c51 100644
--- a/libc/stdio/vasprintf.c
+++ b/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>
diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c
index 07e4a208c..fb042544f 100644
--- a/libc/stdlib/abort.c
+++ b/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>
diff --git a/libc/stdlib/drand48.c b/libc/stdlib/drand48.c
index d18ff3f08..fc66816c1 100644
--- a/libc/stdlib/drand48.c
+++ b/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. */
diff --git a/libc/stdlib/drand48_r.c b/libc/stdlib/drand48_r.c
index b6c055c1f..14235e6e0 100644
--- a/libc/stdlib/drand48_r.c
+++ b/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>
diff --git a/libc/stdlib/erand48.c b/libc/stdlib/erand48.c
index 6d4c72683..96a8ad115 100644
--- a/libc/stdlib/erand48.c
+++ b/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. */
diff --git a/libc/stdlib/erand48_r.c b/libc/stdlib/erand48_r.c
index 159eb83a6..0a69266a7 100644
--- a/libc/stdlib/erand48_r.c
+++ b/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)
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c
index 9dfc0d132..6cbdc3e65 100644
--- a/libc/stdlib/getenv.c
+++ b/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)
diff --git a/libc/stdlib/jrand48.c b/libc/stdlib/jrand48.c
index 1106f1f9f..44b32487f 100644
--- a/libc/stdlib/jrand48.c
+++ b/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. */
diff --git a/libc/stdlib/jrand48_r.c b/libc/stdlib/jrand48_r.c
index d8c37cdbc..a21bda080 100644
--- a/libc/stdlib/jrand48_r.c
+++ b/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)
diff --git a/libc/stdlib/lrand48.c b/libc/stdlib/lrand48.c
index c6396c047..88301d70f 100644
--- a/libc/stdlib/lrand48.c
+++ b/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. */
diff --git a/libc/stdlib/lrand48_r.c b/libc/stdlib/lrand48_r.c
index c2851efd7..0ff1ef25e 100644
--- a/libc/stdlib/lrand48_r.c
+++ b/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)
diff --git a/libc/stdlib/malloc/malloc_debug.c b/libc/stdlib/malloc/malloc_debug.c
index d231fa7b6..b93b1eac6 100644
--- a/libc/stdlib/malloc/malloc_debug.c
+++ b/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);
diff --git a/libc/stdlib/mrand48.c b/libc/stdlib/mrand48.c
index a732603e5..e9d5353ad 100644
--- a/libc/stdlib/mrand48.c
+++ b/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. */
diff --git a/libc/stdlib/mrand48_r.c b/libc/stdlib/mrand48_r.c
index 74351a059..f79e5f887 100644
--- a/libc/stdlib/mrand48_r.c
+++ b/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)
diff --git a/libc/stdlib/nrand48.c b/libc/stdlib/nrand48.c
index 585bfe7fd..6cdf4ebad 100644
--- a/libc/stdlib/nrand48.c
+++ b/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. */
diff --git a/libc/stdlib/nrand48_r.c b/libc/stdlib/nrand48_r.c
index 89f098e75..f72c07030 100644
--- a/libc/stdlib/nrand48_r.c
+++ b/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)
diff --git a/libc/stdlib/srand48.c b/libc/stdlib/srand48.c
index a172d07a1..1dcdc14a7 100644
--- a/libc/stdlib/srand48.c
+++ b/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. */
diff --git a/libc/stdlib/srand48_r.c b/libc/stdlib/srand48_r.c
index c0fa38e90..d2f959c79 100644
--- a/libc/stdlib/srand48_r.c
+++ b/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)
diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c
index b365ef82e..7dba803ac 100644
--- a/libc/stdlib/system.c
+++ b/libc/stdlib/system.c
@@ -1,3 +1,5 @@
+#define wait4 __wait4
+
#include <stdio.h>
#include <stddef.h>
#include <signal.h>
diff --git a/libc/stdlib/unix_grantpt.c b/libc/stdlib/unix_grantpt.c
index 5d21ec9f8..9bd374978 100644
--- a/libc/stdlib/unix_grantpt.c
+++ b/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>
diff --git a/libc/stdlib/valloc.c b/libc/stdlib/valloc.c
index c1d6d29a5..d4f21d121 100644
--- a/libc/stdlib/valloc.c
+++ b/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>
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index 91d30116f..f2c860107 100644
--- a/libc/string/generic/mempcpy.c
+++ b/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);
diff --git a/libc/sysdeps/linux/arm/sigaction.c b/libc/sysdeps/linux/arm/sigaction.c
index b4f658f14..e2da4f87c 100644
--- a/libc/sysdeps/linux/arm/sigaction.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c
index c50eadbbe..3c3d99c2a 100644
--- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
index 9d4916618..be7709040 100644
--- a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
+++ b/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);
diff --git a/libc/sysdeps/linux/common/__syscall_sigaction.c b/libc/sysdeps/linux/common/__syscall_sigaction.c
index 6c33b2802..4333a6a1a 100644
--- a/libc/sysdeps/linux/common/__syscall_sigaction.c
+++ b/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
diff --git a/libc/sysdeps/linux/common/adjtimex.c b/libc/sysdeps/linux/common/adjtimex.c
index 28ad442e8..ef33051e8 100644
--- a/libc/sysdeps/linux/common/adjtimex.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/alarm.c b/libc/sysdeps/linux/common/alarm.c
index 7e554fcbf..eec941d07 100644
--- a/libc/sysdeps/linux/common/alarm.c
+++ b/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
diff --git a/libc/sysdeps/linux/common/clock_settime.c b/libc/sysdeps/linux/common/clock_settime.c
index 40dadc78d..e2ec03f78 100644
--- a/libc/sysdeps/linux/common/clock_settime.c
+++ b/libc/sysdeps/linux/common/clock_settime.c
@@ -19,6 +19,8 @@
*
*/
+#define settimeofday __settimeofday
+
#define _GNU_SOURCE
#include "syscalls.h"
#include <time.h>
diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c
index d0865fba5..486ee9335 100644
--- a/libc/sysdeps/linux/common/getdirname.c
+++ b/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
diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c
index 8cbcebdce..de3af63d7 100644
--- a/libc/sysdeps/linux/common/getdtablesize.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c
index 8469cbb76..669cdb075 100644
--- a/libc/sysdeps/linux/common/getpagesize.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c
index a4e07d97c..6a6a9e129 100644
--- a/libc/sysdeps/linux/common/getpid.c
+++ b/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) */
diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/getppid.c
index efd542863..b2944e5e0 100644
--- a/libc/sysdeps/linux/common/getppid.c
+++ b/libc/sysdeps/linux/common/getppid.c
@@ -14,6 +14,6 @@ _syscall0(pid_t, getppid);
# else
pid_t getppid(void)
{
- return (getpid());
+ return (__getpid());
}
# endif
diff --git a/libc/sysdeps/linux/common/kill.c b/libc/sysdeps/linux/common/kill.c
index d8033fabc..2d1d9ae8a 100644
--- a/libc/sysdeps/linux/common/kill.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/ntp_gettime.c b/libc/sysdeps/linux/common/ntp_gettime.c
index 07f380402..0c4d1549f 100644
--- a/libc/sysdeps/linux/common/ntp_gettime.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index 87d0dbb27..f021e0269 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/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>
diff --git a/libc/sysdeps/linux/common/setitimer.c b/libc/sysdeps/linux/common/setitimer.c
index 981f1a158..be51cb5c5 100644
--- a/libc/sysdeps/linux/common/setitimer.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/settimeofday.c b/libc/sysdeps/linux/common/settimeofday.c
index b63c421c7..4e88b3edb 100644
--- a/libc/sysdeps/linux/common/settimeofday.c
+++ b/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)
diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c
index 4c52d070f..7a977f56a 100644
--- a/libc/sysdeps/linux/common/ssp.c
+++ b/libc/sysdeps/linux/common/ssp.c
@@ -16,12 +16,29 @@
* Mike Frysinger <vapier[@]gentoo.org>
*/
+#if defined __SSP__ || defined __SSP_ALL__
+#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
+
+#define openlog __openlog
+#define syslog __syslog
+#define closelog __closelog
+#define sigfillset __sigfillset_internal
+#define sigdelset __sigdelset_internal
+#define sigaction __sigaction_internal
+#define kill __kill
+
#include <string.h>
#include <unistd.h>
+#include <signal.h>
#include <sys/syslog.h>
-#include <ssp-internal.h>
-
static __always_inline void block_signals(void)
{
struct sigaction sa;
@@ -37,7 +54,7 @@ static __always_inline void block_signals(void)
sigfillset(&sa.sa_mask); /* Block all signals */
sa.sa_flags = 0;
sa.sa_handler = SIG_DFL;
- SIGACTION(SSP_SIGTYPE, &sa, NULL);
+ sigaction(SSP_SIGTYPE, &sa, NULL);
}
static __always_inline void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
@@ -46,15 +63,15 @@ static __always_inline void ssp_write(int fd, const char *msg1, const char *msg2
__write(fd, msg2, __strlen(msg2));
__write(fd, msg3, __strlen(msg3));
__write(fd, "()\n", 3);
- openlog("ssp", LOG_CONS | LOG_PID, LOG_USER);
- syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3);
- closelog();
+ __openlog("ssp", LOG_CONS | LOG_PID, LOG_USER);
+ __syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3);
+ __closelog();
}
-static __always_inline void terminate(void)
+static __always_inline attribute_noreturn void terminate(void)
{
- (void) KILL(GETPID(), SSP_SIGTYPE);
- EXIT(127);
+ (void) kill(__getpid(), SSP_SIGTYPE);
+ _exit(127);
}
void attribute_noreturn __stack_smash_handler(char func[], int damaged __attribute__ ((unused)));
diff --git a/libc/sysdeps/linux/common/stime.c b/libc/sysdeps/linux/common/stime.c
index 586088695..bfb7682d0 100644
--- a/libc/sysdeps/linux/common/stime.c
+++ b/libc/sysdeps/linux/common/stime.c
@@ -7,6 +7,8 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define settimeofday __settimeofday
+
#include "syscalls.h"
#include <time.h>
#include <sys/time.h>
diff --git a/libc/sysdeps/linux/common/time.c b/libc/sysdeps/linux/common/time.c
index 0c37c375c..506850ff9 100644
--- a/libc/sysdeps/linux/common/time.c
+++ b/libc/sysdeps/linux/common/time.c
@@ -11,9 +11,10 @@
#include <time.h>
#include <sys/time.h>
#ifdef __NR_time
-_syscall1(time_t, time, time_t *, t);
+#define __NR___time __NR_time
+attribute_hidden _syscall1(time_t, __time, time_t *, t);
#else
-time_t time(time_t * t)
+time_t attribute_hidden __time(time_t * t)
{
time_t result;
struct timeval tv;
@@ -29,3 +30,4 @@ time_t time(time_t * t)
return result;
}
#endif
+strong_alias(__time,time)
diff --git a/libc/sysdeps/linux/common/times.c b/libc/sysdeps/linux/common/times.c
index beb07fb35..0fefdca10 100644
--- a/libc/sysdeps/linux/common/times.c
+++ b/libc/sysdeps/linux/common/times.c
@@ -9,4 +9,6 @@
#include "syscalls.h"
#include <sys/times.h>
-_syscall1(clock_t, times, struct tms *, buf);
+#define __NR___times __NR_times
+attribute_hidden _syscall1(clock_t, __times, struct tms *, buf);
+strong_alias(__times,times)
diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c
index d7a71d690..5515488cd 100644
--- a/libc/sysdeps/linux/common/utime.c
+++ b/libc/sysdeps/linux/common/utime.c
@@ -7,14 +7,17 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define utimes __utimes
+
#include "syscalls.h"
#include <utime.h>
#ifdef __NR_utime
-_syscall2(int, utime, const char *, file, const struct utimbuf *, times);
+#define __NR___utime __NR_utime
+attribute_hidden _syscall2(int, __utime, const char *, file, const struct utimbuf *, times);
#else
#include <stdlib.h>
#include <sys/time.h>
-int utime(const char *file, const struct utimbuf *times)
+int attribute_hidden __utime(const char *file, const struct utimbuf *times)
{
struct timeval timevals[2];
@@ -32,3 +35,4 @@ int utime(const char *file, const struct utimbuf *times)
return utimes(file, timevals);
}
#endif
+strong_alias(__utime,utime)
diff --git a/libc/sysdeps/linux/common/utimes.c b/libc/sysdeps/linux/common/utimes.c
index ef0fffe11..ca45204c7 100644
--- a/libc/sysdeps/linux/common/utimes.c
+++ b/libc/sysdeps/linux/common/utimes.c
@@ -7,14 +7,17 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define utime __utime
+
#include "syscalls.h"
#include <utime.h>
#ifdef __NR_utimes
-_syscall2(int, utimes, const char *, file, const struct timeval *, tvp);
+#define __NR___utimes __NR_utimes
+attribute_hidden _syscall2(int, __utimes, const char *, file, const struct timeval *, tvp);
#else
#include <stdlib.h>
#include <sys/time.h>
-int utimes(const char *file, const struct timeval tvp[2])
+int attribute_hidden __utimes(const char *file, const struct timeval tvp[2])
{
struct utimbuf buf, *times;
@@ -28,3 +31,4 @@ int utimes(const char *file, const struct timeval tvp[2])
return utime(file, times);
}
#endif
+strong_alias(__utimes,utimes)
diff --git a/libc/sysdeps/linux/common/wait.c b/libc/sysdeps/linux/common/wait.c
index 6c46d0caa..b2a6d2295 100644
--- a/libc/sysdeps/linux/common/wait.c
+++ b/libc/sysdeps/linux/common/wait.c
@@ -1,3 +1,5 @@
+#define wait4 __wait4
+
#include <stdlib.h>
#include <syscall.h>
#include <sys/types.h>
@@ -6,8 +8,8 @@
/* Wait for a child to die. When one does, put its status in *STAT_LOC
* and return its process ID. For errors, return (pid_t) -1. */
-__pid_t __libc_wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
{
- return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+ return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
}
-weak_alias(__libc_wait, wait)
+weak_alias(wait,__libc_wait)
diff --git a/libc/sysdeps/linux/common/wait3.c b/libc/sysdeps/linux/common/wait3.c
index 6a8bc77fc..4b4d6aef1 100644
--- a/libc/sysdeps/linux/common/wait3.c
+++ b/libc/sysdeps/linux/common/wait3.c
@@ -1,3 +1,5 @@
+#define wait4 __wait4
+
#include <syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/libc/sysdeps/linux/common/wait4.c b/libc/sysdeps/linux/common/wait4.c
index 5434a009e..b5a2c5933 100644
--- a/libc/sysdeps/linux/common/wait4.c
+++ b/libc/sysdeps/linux/common/wait4.c
@@ -14,7 +14,8 @@
static inline _syscall4(int, __syscall_wait4, __kernel_pid_t, pid,
int *, status, int, opts, struct rusage *, rusage);
-pid_t wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
+pid_t attribute_hidden __wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
{
return (__syscall_wait4(pid, status, opts, rusage));
}
+strong_alias(__wait4,wait4)
diff --git a/libc/sysdeps/linux/common/waitpid.c b/libc/sysdeps/linux/common/waitpid.c
index fef93173b..612917fcf 100644
--- a/libc/sysdeps/linux/common/waitpid.c
+++ b/libc/sysdeps/linux/common/waitpid.c
@@ -1,11 +1,14 @@
+#define wait4 __wait4
+
#include <stdlib.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/resource.h>
-__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options)
+__pid_t attribute_hidden __waitpid(__pid_t pid, int *wait_stat, int options)
{
- return wait4(pid, wait_stat, options, NULL);
+ return __wait4(pid, wait_stat, options, NULL);
}
-weak_alias(__libc_waitpid, waitpid)
+strong_alias(__waitpid,waitpid)
+weak_alias(__waitpid,__libc_waitpid)
diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c
index 0875796cf..d7898c598 100644
--- a/libc/sysdeps/linux/i386/sigaction.c
+++ b/libc/sysdeps/linux/i386/sigaction.c
@@ -34,7 +34,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
/* 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;
@@ -76,7 +76,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
/* 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 old_kernel_sigaction kact, koact;
@@ -119,7 +119,8 @@ 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)
@@ -162,4 +163,3 @@ asm \
);
RESTORE (restore, __NR_sigreturn)
-
diff --git a/libc/sysdeps/linux/mips/sigaction.c b/libc/sysdeps/linux/mips/sigaction.c
index 245886dbd..f703f33cd 100644
--- a/libc/sysdeps/linux/mips/sigaction.c
+++ b/libc/sysdeps/linux/mips/sigaction.c
@@ -32,7 +32,7 @@
/* 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;
@@ -77,7 +77,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
/* 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 old_kernel_sigaction kact, koact;
@@ -118,4 +118,5 @@ 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)
diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c
index ac10bc5aa..32b13c064 100644
--- a/libc/sysdeps/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/linux/x86_64/sigaction.c
@@ -44,8 +44,10 @@ extern void restore (void) asm ("__restore") attribute_hidden;
/* 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)
+/* psm: couldn't use __sigaction, if building w/ disabled hidden,
+ * it will conflict w/ the one in libpthread */
+int attribute_hidden
+__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
{
int result;
struct kernel_sigaction kact, koact;
@@ -77,8 +79,8 @@ extern void restore (void) asm ("__restore") attribute_hidden;
/* 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 old_kernel_sigaction kact, koact;
@@ -117,8 +119,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
return result;
}
#endif
-
-weak_alias (__libc_sigaction, sigaction)
+strong_alias(__sigaction_internal,__libc_sigaction)
+weak_alias(__sigaction_internal,sigaction)
/* NOTE: Please think twice before making any changes to the bits of
code below. GDB needs some intimate knowledge about it to
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c
index 7bf58289b..b09bdfef4 100644
--- a/libc/unistd/exec.c
+++ b/libc/unistd/exec.c
@@ -250,7 +250,7 @@ int execvp(const char *path, char *const argv[])
EXEC_FREE(nargv, size2);
}
} else {
- if ((p = getenv("PATH")) != NULL) {
+ if ((p = __getenv("PATH")) != NULL) {
if (!*p) {
goto BAD;
}
diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c
index e1685692c..0747a49f6 100644
--- a/libc/unistd/getlogin.c
+++ b/libc/unistd/getlogin.c
@@ -29,14 +29,15 @@
* the user specify whatever they want via the LOGNAME environment
* variable, or we return NULL if getenv() fails to find anything */
-char * getlogin(void)
+extern char attribute_hidden * __getlogin(void)
{
- return (getenv("LOGNAME"));
+ return (__getenv("LOGNAME"));
}
+strong_alias(__getlogin,getlogin)
int getlogin_r(char *name, size_t len)
{
- char * foo = getenv("LOGNAME");
+ char * foo = __getenv("LOGNAME");
if (! foo)
return -1;
@@ -48,7 +49,7 @@ int getlogin_r(char *name, size_t len)
char *cuserid(char *s)
{
- char *name = getlogin();
+ char *name = __getlogin();
if (s) {
return(__strcpy(s, name ? name : ""));
}
diff --git a/libc/unistd/getopt.c b/libc/unistd/getopt.c
index 216e0575a..fc3a013c2 100644
--- a/libc/unistd/getopt.c
+++ b/libc/unistd/getopt.c
@@ -247,7 +247,7 @@ static const char *_getopt_initialize (int argc, char *const * argv, const char
ordering = REQUIRE_ORDER;
++optstring;
}
- else if (getenv ("POSIXLY_CORRECT") != NULL)
+ else if (__getenv ("POSIXLY_CORRECT") != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
diff --git a/libc/unistd/sleep.c b/libc/unistd/sleep.c
index 01a9b641b..b704cd905 100644
--- a/libc/unistd/sleep.c
+++ b/libc/unistd/sleep.c
@@ -18,6 +18,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define sigaction __sigaction_internal
+
#include <errno.h>
#include <time.h>
#include <signal.h>
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 2346ad831..c80a9e94e 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -16,7 +16,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define getpagesize __libc_getpagesize
+#define getpagesize __getpagesize_internal
+#define getdtablesize __getdtablesize
#define _XOPEN_SOURCE 500
#include <features.h>
diff --git a/libc/unistd/ualarm.c b/libc/unistd/ualarm.c
index 207a47298..3bcb8e463 100644
--- a/libc/unistd/ualarm.c
+++ b/libc/unistd/ualarm.c
@@ -1,3 +1,5 @@
+#define setitimer __setitimer
+
#define _GNU_SOURCE
#include <time.h>
#include <sys/time.h>