summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib')
-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
9 files changed, 31 insertions, 10 deletions
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>