summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c11
-rw-r--r--libc/inet/rpc/auth_unix.c3
-rw-r--r--libc/inet/rpc/clnt_tcp.c1
-rw-r--r--libc/inet/rpc/clnt_unix.c2
-rw-r--r--libc/inet/rpc/rcmd.c1
-rw-r--r--libc/inet/rpc/ruserpass.c2
-rw-r--r--libc/inet/rpc/svc.c5
-rw-r--r--libc/inet/rpc/svc_tcp.c3
-rw-r--r--libc/inet/rpc/svc_udp.c2
-rw-r--r--libc/inet/rpc/svc_unix.c4
-rw-r--r--libc/inet/rpc/xdr_rec.c5
-rw-r--r--libc/misc/ftw/ftw.c1
-rw-r--r--libc/misc/internals/__uClibc_main.c3
-rw-r--r--libc/misc/locale/locale.c4
-rw-r--r--libc/misc/search/tsearch.c3
-rw-r--r--libc/misc/time/time.c18
-rw-r--r--libc/misc/utmp/utent.c7
-rw-r--r--libc/misc/wchar/wchar.c32
-rw-r--r--libc/misc/wchar/wstdio.c2
-rw-r--r--libc/misc/wordexp/wordexp.c1
-rw-r--r--libc/stdio/fgetwc.c2
-rw-r--r--libc/stdio/scanf.c2
-rw-r--r--libc/stdio/vfprintf.c2
-rw-r--r--libc/stdlib/malloc-standard/malloc.h2
-rw-r--r--libc/stdlib/rand.c2
-rw-r--r--libc/stdlib/random.c7
-rw-r--r--libc/stdlib/random_r.c11
-rw-r--r--libc/stdlib/seed48.c2
-rw-r--r--libc/stdlib/seed48_r.c5
-rw-r--r--libc/stdlib/setenv.c6
-rw-r--r--libc/stdlib/stdlib.c5
-rw-r--r--libc/stdlib/unix_grantpt.c1
-rw-r--r--libc/string/generic/bp-checks.h2
-rw-r--r--libc/sysdeps/linux/common/clock_getres.c2
-rw-r--r--libc/sysdeps/linux/common/getegid.c7
-rw-r--r--libc/sysdeps/linux/common/getgid.c3
-rw-r--r--libc/sysdeps/linux/common/getgroups.c2
-rw-r--r--libc/sysdeps/linux/common/setgroups.c2
-rw-r--r--libc/sysdeps/linux/common/ulimit.c2
-rw-r--r--libc/unistd/sysconf.c5
40 files changed, 135 insertions, 47 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 01ccdb819..0fee6a597 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -137,6 +137,7 @@
#define strnlen __strnlen
#define strncat __strncat
#define strstr __strstr
+#define random __random
#define __FORCE_GLIBC
#include <features.h>
@@ -279,6 +280,11 @@ extern int __libc_ns_name_unpack(const u_char *, const u_char *, const u_char *,
u_char *, size_t) attribute_hidden;
+extern int __gethostent_r (struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop) attribute_hidden;
+
#ifdef L_encodeh
int attribute_hidden __encode_header(struct resolv_header *h, unsigned char *dest, int maxlen)
{
@@ -1604,7 +1610,7 @@ void sethostent (int stay_open)
UNLOCK;
}
-int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
+int attribute_hidden __gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
struct hostent **result, int *h_errnop)
{
int ret;
@@ -1627,6 +1633,7 @@ int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
UNLOCK;
return(ret);
}
+strong_alias(__gethostent_r,gethostent_r)
struct hostent *gethostent (void)
{
@@ -1642,7 +1649,7 @@ struct hostent *gethostent (void)
struct hostent *host;
LOCK;
- gethostent_r(&h, buf, sizeof(buf), &host, &h_errno);
+ __gethostent_r(&h, buf, sizeof(buf), &host, &h_errno);
UNLOCK;
return(host);
}
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c
index 4adb165cf..787e08b13 100644
--- a/libc/inet/rpc/auth_unix.c
+++ b/libc/inet/rpc/auth_unix.c
@@ -38,6 +38,9 @@
* for the credentials.
*/
+#define sysconf __sysconf
+#define getegid __getegid
+
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index 6ccd1ca53..62c95bbf0 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/libc/inet/rpc/clnt_tcp.c
@@ -51,6 +51,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 __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index cbdd0eba8..a6ac295ad 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/libc/inet/rpc/clnt_unix.c
@@ -47,6 +47,8 @@
*/
#define authnone_create __authnone_create
+#define xdrrec_create __xdrrec_create
+#define getegid __getegid
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index f9f29285e..cb4866b7a 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -36,6 +36,7 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#endif /* LIBC_SCCS and not lint */
#define bcopy __bcopy
+#define sysconf __sysconf
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c
index 77a22240e..9963ac3e9 100644
--- a/libc/inet/rpc/ruserpass.c
+++ b/libc/inet/rpc/ruserpass.c
@@ -28,6 +28,8 @@
*/
#define __fsetlocking __libc_fsetlocking
+#define getgid __getgid
+#define getegid __getegid
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c
index 08678ba79..a32c68bbc 100644
--- a/libc/inet/rpc/svc.c
+++ b/libc/inet/rpc/svc.c
@@ -85,8 +85,8 @@ static struct svc_callout *svc_head;
/* *************** SVCXPRT related stuff **************** */
/* Activate a transport handle. */
-void
-xprt_register (SVCXPRT *xprt)
+void attribute_hidden
+__xprt_register (SVCXPRT *xprt)
{
register int sock = xprt->xp_sock;
register int i;
@@ -125,6 +125,7 @@ xprt_register (SVCXPRT *xprt)
POLLRDNORM | POLLRDBAND);
}
}
+strong_alias(__xprt_register,xprt_register)
/* De-activate a transport handle. */
void
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index e7ec083c8..05e1d2dbe 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -41,6 +41,9 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
* and a record/tcp stream.
*/
+#define xdrrec_create __xdrrec_create
+#define xprt_register __xprt_register
+
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index 5e5dee9a3..88fde6c0f 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -39,6 +39,8 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
* Copyright (C) 1984, Sun Microsystems, Inc.
*/
+#define xprt_register __xprt_register
+
#define __FORCE_GLIBC
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index 8e052d8a2..e3b3e8c11 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -37,6 +37,10 @@
* and a record/unix stream.
*/
+#define xdrrec_create __xdrrec_create
+#define xprt_register __xprt_register
+#define getegid __getegid
+
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/xdr_rec.c b/libc/inet/rpc/xdr_rec.c
index 9c21f57f4..abe81bb58 100644
--- a/libc/inet/rpc/xdr_rec.c
+++ b/libc/inet/rpc/xdr_rec.c
@@ -142,8 +142,8 @@ static bool_t get_input_bytes (RECSTREAM *, caddr_t, int) internal_function;
* write respectively. They are like the system
* calls expect that they take an opaque handle rather than an fd.
*/
-void
-xdrrec_create (XDR *xdrs, u_int sendsize,
+void attribute_hidden
+__xdrrec_create (XDR *xdrs, u_int sendsize,
u_int recvsize, caddr_t tcp_handle,
int (*readit) (char *, char *, int),
int (*writeit) (char *, char *, int))
@@ -204,6 +204,7 @@ xdrrec_create (XDR *xdrs, u_int sendsize,
rstrm->fbtbc = 0;
rstrm->last_frag = TRUE;
}
+strong_alias(__xdrrec_create,xdrrec_create)
/*
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index cf410ba02..48b385c19 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define mempcpy __libc_mempcpy
+#define tsearch __tsearch
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 8685f5a94..2db8b078a 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -13,6 +13,9 @@
* avoided in the static library case.
*/
+#define getgid __getgid
+#define getegid __getegid
+
#define _ERRNO_H
#include <features.h>
#include <unistd.h>
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index da62b04ce..f46dabc2d 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -1415,8 +1415,8 @@ __locale_t weak_function __curlocale_set(__locale_t newloc)
#define Cc2wc_ROW_LEN __LOCALE_DATA_Cc2wc_ROW_LEN
extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
- const char **__restrict src, size_t n,
- mbstate_t *ps, int allow_continuation);
+ const char **__restrict src, size_t n,
+ mbstate_t *ps, int allow_continuation) attribute_hidden;
int __locale_mbrtowc_l(wchar_t *__restrict dst,
const char *__restrict src,
diff --git a/libc/misc/search/tsearch.c b/libc/misc/search/tsearch.c
index 72abcee7b..1da6b571e 100644
--- a/libc/misc/search/tsearch.c
+++ b/libc/misc/search/tsearch.c
@@ -51,7 +51,7 @@ register node **rootp; address of tree root
int (*compar)(); ordering function
*/
-void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar)
+void attribute_hidden *__tsearch(__const void *key, void **vrootp, __compar_fn_t compar)
{
register node *q;
register node **rootp = (node **) vrootp;
@@ -77,6 +77,7 @@ void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar)
}
return (q);
}
+strong_alias(__tsearch,tsearch)
#endif
#ifdef L_tfind
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 67add6845..e1e86db91 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -131,6 +131,7 @@
#define _uintmaxtostr __libc__uintmaxtostr
#define strnlen __strnlen
+#define memcpy __memcpy
#define _GNU_SOURCE
#include <stdio.h>
@@ -224,15 +225,21 @@ extern struct tm *__time_localtime_tzi(const time_t *__restrict timer,
extern time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success,
rule_struct *tzi) attribute_hidden;
+extern char *__asctime (__const struct tm *__tp) attribute_hidden;
+
+extern char *__asctime_r (__const struct tm *__restrict __tp,
+ char *__restrict __buf) attribute_hidden;
+
/**********************************************************************/
#ifdef L_asctime
static char __time_str[26];
-char *asctime(const struct tm *__restrict ptm)
+char attribute_hidden *__asctime(const struct tm *ptm)
{
- return asctime_r(ptm, __time_str);
+ return __asctime_r(ptm, __time_str);
}
+strong_alias(__asctime,asctime)
#endif
/**********************************************************************/
@@ -300,7 +307,7 @@ static const unsigned char at_data[] = {
' ', '?', '?', '?', '?', '\n', 0
};
-char *asctime_r(register const struct tm *__restrict ptm,
+char attribute_hidden *__asctime_r(register const struct tm *__restrict ptm,
register char *__restrict buffer)
{
int tmp;
@@ -374,6 +381,7 @@ char *asctime_r(register const struct tm *__restrict ptm,
return buffer - 8;
}
+strong_alias(__asctime_r,asctime_r)
#endif
/**********************************************************************/
@@ -448,7 +456,7 @@ clock_t clock(void)
char *ctime(const time_t *clock)
{
/* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */
- return asctime(localtime(clock));
+ return __asctime(localtime(clock));
}
#endif
@@ -459,7 +467,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
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index c1d8d6fa2..1cb0b79b2 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -108,7 +108,7 @@ struct utmp *getutent(void)
}
/* Locking is done in __getutent */
-struct utmp *getutid (const struct utmp *utmp_entry)
+struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry)
{
struct utmp *lutmp;
@@ -133,6 +133,7 @@ struct utmp *getutid (const struct utmp *utmp_entry)
return NULL;
}
+strong_alias(__getutid,getutid)
/* Locking is done in __getutent */
struct utmp *getutline(const struct utmp *utmp_entry)
@@ -150,6 +151,8 @@ struct utmp *getutline(const struct utmp *utmp_entry)
return NULL;
}
+extern struct utmp *getutid (__const struct utmp *__id) attribute_hidden;
+
struct utmp *pututline (const struct utmp *utmp_entry)
{
LOCK;
@@ -157,7 +160,7 @@ struct utmp *pututline (const struct utmp *utmp_entry)
the file pointer where they want it, everything will work out. */
lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
- if (getutid(utmp_entry) != NULL) {
+ if (__getutid(utmp_entry) != NULL) {
lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
return NULL;
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 25f8efa7b..055900827 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -176,11 +176,11 @@ extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
/* Implementation-specific work functions. */
extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
- const char **__restrict src, size_t n,
- mbstate_t *ps, int allow_continuation);
+ const char **__restrict src, size_t n,
+ mbstate_t *ps, int allow_continuation) attribute_hidden;
extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
- const wchar_t **__restrict src, size_t wn);
+ const wchar_t **__restrict src, size_t wn) attribute_hidden;
/* glibc extensions. */
@@ -271,15 +271,13 @@ int mbsinit(const mbstate_t *ps)
/**********************************************************************/
#ifdef L_mbrlen
-size_t __mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
+size_t attribute_hidden __mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
{
static mbstate_t mbstate; /* Rely on bss 0-init. */
return __mbrtowc(NULL, s, n, (ps != NULL) ? ps : &mbstate);
}
-
-size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
- __attribute__ ((__weak__, __alias__("__mbrlen")));
+strong_alias(__mbrlen,mbrlen)
#endif
/**********************************************************************/
@@ -372,7 +370,7 @@ strong_alias(__wcrtomb,wcrtomb)
/**********************************************************************/
#ifdef L_mbsrtowcs
-size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
+size_t attribute_hidden __mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
static mbstate_t mbstate; /* Rely on bss 0-init. */
@@ -380,6 +378,7 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
return __mbsnrtowcs(dst, src, SIZE_MAX, len,
((ps != NULL) ? ps : &mbstate));
}
+strong_alias(__mbsrtowcs,mbsrtowcs)
#endif
/**********************************************************************/
@@ -389,11 +388,12 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
* TODO: Check for valid state anyway? */
-size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
+size_t attribute_hidden __wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
return __wcsnrtombs(dst, src, SIZE_MAX, len, ps);
}
+strong_alias(__wcsrtombs,wcsrtombs)
#endif
/**********************************************************************/
@@ -410,7 +410,7 @@ size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
#endif
#endif
-size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
+size_t attribute_hidden _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
const char **__restrict src, size_t n,
mbstate_t *ps, int allow_continuation)
{
@@ -581,7 +581,7 @@ size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
/**********************************************************************/
#ifdef L__wchar_wcsntoutf8s
-size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
+size_t attribute_hidden _wchar_wcsntoutf8s(char *__restrict s, size_t n,
const wchar_t **__restrict src, size_t wn)
{
register char *p;
@@ -1034,7 +1034,7 @@ static const signed char new_wtbl[] = {
0, 2, 1, 2, 1, 0, 1,
};
-int wcswidth(const wchar_t *pwcs, size_t n)
+int attribute_hidden __wcswidth(const wchar_t *pwcs, size_t n)
{
int h, l, m, count;
wchar_t wc;
@@ -1131,7 +1131,7 @@ int wcswidth(const wchar_t *pwcs, size_t n)
#else /* __UCLIBC_HAS_LOCALE__ */
-int wcswidth(const wchar_t *pwcs, size_t n)
+int attribute_hidden __wcswidth(const wchar_t *pwcs, size_t n)
{
int count;
wchar_t wc;
@@ -1154,13 +1154,17 @@ int wcswidth(const wchar_t *pwcs, size_t n)
#endif /* __UCLIBC_HAS_LOCALE__ */
+strong_alias(__wcswidth,wcswidth)
+
#endif
/**********************************************************************/
#ifdef L_wcwidth
+extern int __wcswidth (__const wchar_t *__s, size_t __n) attribute_hidden;
+
int wcwidth(wchar_t wc)
{
- return wcswidth(&wc, 1);
+ return __wcswidth(&wc, 1);
}
#endif
diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c
index 55acc7187..6d4c2732f 100644
--- a/libc/misc/wchar/wstdio.c
+++ b/libc/misc/wchar/wstdio.c
@@ -50,6 +50,8 @@
*/
#define wcslen __wcslen
+#define wcsrtombs __wcsrtombs
+#define mbrtowc __mbrtowc
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index 979723524..da20ad0a4 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/libc/misc/wordexp/wordexp.c
@@ -22,6 +22,7 @@
#define mempcpy __libc_mempcpy
#define strndup __strndup
#define strspn __strspn
+#define unsetenv __unsetenv
#define _GNU_SOURCE
#include <sys/cdefs.h>
diff --git a/libc/stdio/fgetwc.c b/libc/stdio/fgetwc.c
index 560c4ed73..cb200851b 100644
--- a/libc/stdio/fgetwc.c
+++ b/libc/stdio/fgetwc.c
@@ -5,6 +5,8 @@
* Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
*/
+#define mbrtowc __mbrtowc
+
#include "_stdio.h"
#ifdef __DO_UNLOCKED
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index a320a2d31..ed424f163 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -44,6 +44,8 @@
*/
#define wcslen __wcslen
+#define mbsrtowcs __mbsrtowcs
+#define mbrtowc __mbrtowc
#define _ISOC99_SOURCE /* for LLONG_MAX primarily... */
#define _GNU_SOURCE
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index bb8815416..0852c9915 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -92,6 +92,8 @@
#define strnlen __strnlen
#define wcslen __wcslen
#define wcsnlen __wcsnlen
+#define wcsrtombs __wcsrtombs
+#define mbsrtowcs __mbsrtowcs
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index fbc14924e..dbac0c9d2 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -14,6 +14,8 @@
Hacked up for uClibc by Erik Andersen <andersen@codepoet.org>
*/
+#define sysconf __sysconf
+
#include <features.h>
#include <stddef.h>
#include <unistd.h>
diff --git a/libc/stdlib/rand.c b/libc/stdlib/rand.c
index cacad5bf3..a4c739c18 100644
--- a/libc/stdlib/rand.c
+++ b/libc/stdlib/rand.c
@@ -17,6 +17,8 @@
* write to the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge, MA 02139, USA. */
+#define random __random
+
#include <stdlib.h>
int rand (void)
diff --git a/libc/stdlib/random.c b/libc/stdlib/random.c
index b0a00e15c..833877039 100644
--- a/libc/stdlib/random.c
+++ b/libc/stdlib/random.c
@@ -22,6 +22,9 @@
* Rewritten to use reentrant functions by Ulrich Drepper, 1995.
*/
+#define random_r __random_r
+#define srandom_r __srandom_r
+
#define _GNU_SOURCE
#include <features.h>
#include <limits.h>
@@ -243,7 +246,7 @@ char * setstate (char *arg_state)
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
-long int random ()
+long int attribute_hidden __random ()
{
int32_t retval;
@@ -252,4 +255,4 @@ long int random ()
__pthread_mutex_unlock(&lock);
return retval;
}
-
+strong_alias(__random,random)
diff --git a/libc/stdlib/random_r.c b/libc/stdlib/random_r.c
index fce3a98ab..6631d85a8 100644
--- a/libc/stdlib/random_r.c
+++ b/libc/stdlib/random_r.c
@@ -131,7 +131,7 @@ static const struct random_poly_info random_poly_info =
information a given number of times to get rid of any initial dependencies
introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
for default usage relies on values produced by this routine. */
-int srandom_r (unsigned int seed, struct random_data *buf)
+int attribute_hidden __srandom_r (unsigned int seed, struct random_data *buf)
{
int type;
int32_t *state;
@@ -176,7 +176,7 @@ int srandom_r (unsigned int seed, struct random_data *buf)
while (--kc >= 0)
{
int32_t discard;
- (void) random_r (buf, &discard);
+ (void) __random_r (buf, &discard);
}
done:
@@ -185,6 +185,7 @@ done:
fail:
return -1;
}
+strong_alias(__srandom_r,srandom_r)
/* Initialize the state information in the given array of N bytes for
future random number generation. Based on the number of bytes we
@@ -237,7 +238,7 @@ int initstate_r (seed, arg_state, n, buf)
buf->state = state;
- srandom_r (seed, buf);
+ __srandom_r (seed, buf);
state[-1] = TYPE_0;
if (type != TYPE_0)
@@ -313,7 +314,7 @@ fail:
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
-int random_r (buf, result)
+int attribute_hidden __random_r (buf, result)
struct random_data *buf;
int32_t *result;
{
@@ -362,4 +363,4 @@ fail:
__set_errno (EINVAL);
return -1;
}
-
+strong_alias(__random_r,random_r)
diff --git a/libc/stdlib/seed48.c b/libc/stdlib/seed48.c
index ec1ef252e..3de07aa31 100644
--- a/libc/stdlib/seed48.c
+++ b/libc/stdlib/seed48.c
@@ -17,6 +17,8 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define seed48_r __seed48_r
+
#include <stdlib.h>
/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
diff --git a/libc/stdlib/seed48_r.c b/libc/stdlib/seed48_r.c
index 734b5e39d..0bfe11f43 100644
--- a/libc/stdlib/seed48_r.c
+++ b/libc/stdlib/seed48_r.c
@@ -17,11 +17,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define memcpy __memcpy
+
#include <stdlib.h>
#include <string.h>
#include <limits.h>
-int seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer)
+int attribute_hidden __seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer)
{
/* Save old value at a private place to be used as return value. */
memcpy (buffer->__old_x, buffer->__x, sizeof (buffer->__x));
@@ -36,3 +38,4 @@ int seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer)
return 0;
}
+strong_alias(__seed48_r,seed48_r)
diff --git a/libc/stdlib/setenv.c b/libc/stdlib/setenv.c
index 5545c6782..5df8b0d98 100644
--- a/libc/stdlib/setenv.c
+++ b/libc/stdlib/setenv.c
@@ -38,6 +38,7 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
# define UNLOCK
#endif
+extern int __unsetenv (__const char *__name) attribute_hidden;
/* If this variable is not a null pointer we allocated the current
environment. */
@@ -139,7 +140,7 @@ int setenv (const char *name, const char *value, int replace)
return __add_to_environ (name, value, NULL, replace);
}
-int unsetenv (const char *name)
+int attribute_hidden __unsetenv (const char *name)
{
size_t len;
char **ep;
@@ -167,6 +168,7 @@ int unsetenv (const char *name)
UNLOCK;
return 0;
}
+strong_alias(__unsetenv,unsetenv)
/* The `clearenv' was planned to be added to POSIX.1 but probably
never made it. Nevertheless the POSIX.9 standard (POSIX bindings
@@ -197,7 +199,7 @@ int putenv (char *string)
free(name);
return(result);
}
- unsetenv (string);
+ __unsetenv (string);
return 0;
}
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index eab6db24a..fb8ce186b 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -32,6 +32,11 @@
* Add wscto{inttype} functions.
*/
+#define wcsrtombs __wcsrtombs
+#define mbsrtowcs __mbsrtowcs
+#define mbrtowc __mbrtowc
+#define mbrlen __mbrlen
+
#define _ISOC99_SOURCE /* for ULLONG primarily... */
#define _GNU_SOURCE
#include <limits.h>
diff --git a/libc/stdlib/unix_grantpt.c b/libc/stdlib/unix_grantpt.c
index d5e68b47e..181fab37f 100644
--- a/libc/stdlib/unix_grantpt.c
+++ b/libc/stdlib/unix_grantpt.c
@@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */
#define memchr __memchr
+#define getgid __getgid
#include <assert.h>
#include <errno.h>
diff --git a/libc/string/generic/bp-checks.h b/libc/string/generic/bp-checks.h
index efbb84716..08c70aa5d 100644
--- a/libc/string/generic/bp-checks.h
+++ b/libc/string/generic/bp-checks.h
@@ -92,7 +92,7 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
cover a region of NBYTES. Such a vector occupies one byte per page
of memory. */
# define CHECK_N_PAGES(ARG, NBYTES) \
- ({ int _page_size_ = sysconf (_SC_PAGE_SIZE); \
+ ({ int _page_size_ = __sysconf (_SC_PAGE_SIZE); \
CHECK_N ((const char *) (ARG), \
((NBYTES) + _page_size_ - 1) / _page_size_); })
diff --git a/libc/sysdeps/linux/common/clock_getres.c b/libc/sysdeps/linux/common/clock_getres.c
index 0ae2bb07d..7aff495d0 100644
--- a/libc/sysdeps/linux/common/clock_getres.c
+++ b/libc/sysdeps/linux/common/clock_getres.c
@@ -19,6 +19,8 @@
*
*/
+#define sysconf __sysconf
+
#define _GNU_SOURCE
#include "syscalls.h"
#include <time.h>
diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c
index ad07f6462..bed60f052 100644
--- a/libc/sysdeps/linux/common/getegid.c
+++ b/libc/sysdeps/linux/common/getegid.c
@@ -7,19 +7,22 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define getgid __getgid
+
#include "syscalls.h"
#include <unistd.h>
#ifdef __NR_getegid
#define __NR___syscall_getegid __NR_getegid
static inline _syscall0(int, __syscall_getegid);
-gid_t getegid(void)
+gid_t attribute_hidden __getegid(void)
{
return (__syscall_getegid());
}
#else
-gid_t getegid(void)
+gid_t attribute_hidden __getegid(void)
{
return (getgid());
}
#endif
+strong_alias(__getegid,getegid)
diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c
index 3d8b43e74..eba29afa2 100644
--- a/libc/sysdeps/linux/common/getgid.c
+++ b/libc/sysdeps/linux/common/getgid.c
@@ -16,7 +16,8 @@
#endif
static inline _syscall0(int, __syscall_getgid);
-gid_t getgid(void)
+gid_t attribute_hidden __getgid(void)
{
return (__syscall_getgid());
}
+strong_alias(__getgid,getgid)
diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c
index 17a7b51c7..402d87e66 100644
--- a/libc/sysdeps/linux/common/getgroups.c
+++ b/libc/sysdeps/linux/common/getgroups.c
@@ -7,6 +7,8 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define sysconf __sysconf
+
#include "syscalls.h"
#include <unistd.h>
diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c
index 4b4a1ddec..d92840370 100644
--- a/libc/sysdeps/linux/common/setgroups.c
+++ b/libc/sysdeps/linux/common/setgroups.c
@@ -7,6 +7,8 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+#define sysconf __sysconf
+
#include "syscalls.h"
#include <unistd.h>
#include <grp.h>
diff --git a/libc/sysdeps/linux/common/ulimit.c b/libc/sysdeps/linux/common/ulimit.c
index 2394edaae..5bbed45a7 100644
--- a/libc/sysdeps/linux/common/ulimit.c
+++ b/libc/sysdeps/linux/common/ulimit.c
@@ -18,6 +18,8 @@
*
*/
+#define sysconf __sysconf
+
#define _GNU_SOURCE
#define _LARGEFILE64_SOURCE
#include <features.h>
diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c
index 4c51c0c2b..2346ad831 100644
--- a/libc/unistd/sysconf.c
+++ b/libc/unistd/sysconf.c
@@ -70,7 +70,7 @@
#endif /* _UCLIBC_GENERATE_SYSCONF_ARCH */
/* Get the value of the system variable NAME. */
-long int __sysconf(int name)
+long int attribute_hidden __sysconf(int name)
{
switch (name)
{
@@ -882,5 +882,4 @@ long int __sysconf(int name)
#endif
}
}
-weak_alias(__sysconf, sysconf);
-
+strong_alias(__sysconf,sysconf)