* conform/data/stdlib.h-data: Account for XPG6 changes.
* stdlib/stdlib.h (__random): Change return value type to long.
(posix_memalign): Cleanup parameter names.
(setenv, unsetenv): Make available for __USE_XOPEN2K.
Change return type of unsetenv to int.
(qecvt, qgcvt, qfcvt): Declare only if __USE_MISC.
* sysdeps/generic/setenv.c (unsetenv): Change return type to int.
Return -1 and set errno if parameter is invalid.
* stdlib/random.c (__random): Change return value type to long.
2001-01-26 Ulrich Drepper <drepper@redhat.com>
+ * conform/data/stdlib.h-data: Account for XPG6 changes.
+ * stdlib/stdlib.h (__random): Change return value type to long.
+ (posix_memalign): Cleanup parameter names.
+ (setenv, unsetenv): Make available for __USE_XOPEN2K.
+ Change return type of unsetenv to int.
+ (qecvt, qgcvt, qfcvt): Declare only if __USE_MISC.
+ * sysdeps/generic/setenv.c (unsetenv): Change return type to int.
+ Return -1 and set errno if parameter is invalid.
+ * stdlib/random.c (__random): Change return value type to long.
+
* conform/data/stdio.h-data: Account for changes in XPG6.
* conform/data/spawn.h-data: Correct posix_spawnattr_setflags
macro MB_CUR_MAX
type div_t
+element div_t int quot
+element div_t int rem
type ldiv_t
+element ldiv_t long quot
+element ldiv_t long rem
+#ifdef XOPEN2K
+type lldiv_t
+element lldiv_t {long long} quot
+element lldiv_t {long long} rem
+#endif
type size_t
type wchar_t
constant WUNTRACED
macro WEXITSTATUS
-macro WIFCONTINUED
macro WIFEXITED
macro WIFSIGNALED
macro WIFSTOPPED
function double atof (const char*)
function int atoi (const char*)
function {long int} atol (const char*)
+#ifdef XOPEN2K
+function {long long} atoll (const char*)
+#endif
function {void*} bsearch (const void*, const void*, size_t, size_t, int(*)(const void*, const void*))
function {void*} calloc (size_t, size_t)
function div_t div (int, int)
function {long int} labs (long int)
function void lcong48 (unsigned short int[7])
function ldiv_t ldiv (long int, long int)
+#ifdef XOPEN2K
+function {long long} llabs (long long)
+function lldiv_t lldiv (long long, long long)
+#endif
function {long int} lrand48 (void)
function {void*} malloc (size_t)
function int mblen (const char*, size_t)
function {long int} mrand48 (void)
function {long int} nrand48 (unsigned short int[3])
function int posix_memalign (void**, size_t, size_t)
+#ifdef XOPEN2K
+function int posix_openpt (int)
+#endif
function {char*} ptsname (int)
function int putenv (char*)
function void qsort (void*, size_t, size_t, int(*)(const void*, const void*))
function {long int} strtol (const char*, char**, int)
function {unsigned long int} strtoul (const char*, char**, int)
function int system (const char*)
+#ifndef XOPEN2K
function int ttyslot (void)
+#endif
function int unlockpt (int)
function int unsetenv (const char*)
function {void*} valloc (size_t)
2001-01-26 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/pthread/bits/pthreadtypes.h: Define pthread_attr_t also
+ as struct __pthread_attr_s.
+
* semaphore.h (sem_t): Cleanup namespace, rename status and
spinlock elements.
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. */
-int32_t
+long int
__random ()
{
int32_t retval;
The `rand' and `srand' functions are required by the ANSI standard.
We provide both interfaces to the same random number generator. */
/* Return a random long integer between 0 and RAND_MAX inclusive. */
-extern int32_t random (void) __THROW;
+extern long int random (void) __THROW;
/* Seed the random number generator with the given number. */
extern void srandom (unsigned int __seed) __THROW;
#ifdef __USE_XOPEN2K
/* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */
-extern int posix_memalign (void **memptr, size_t alignment, size_t size)
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
__THROW __attribute_malloc__;
#endif
extern int putenv (char *__string) __THROW;
#endif
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */
extern int setenv (__const char *__name, __const char *__value, int __replace)
__THROW;
/* Remove the variable NAME from the environment. */
-extern void unsetenv (__const char *__name) __THROW;
+extern int unsetenv (__const char *__name) __THROW;
#endif
#ifdef __USE_MISC
be written to BUF. */
extern char *gcvt (double __value, int __ndigit, char *__buf) __THROW;
+
+# ifdef __USE_MISC
/* Long double versions of above functions. */
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) __THROW;
extern char *qgcvt (long double __value, int __ndigit, char *__buf) __THROW;
-# ifdef __USE_MISC
/* Reentrant version of the functions above which provide their own
buffers. */
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
return __add_to_environ (name, value, NULL, replace);
}
-void
+int
unsetenv (name)
const char *name;
{
- const size_t len = strlen (name);
+ const size_t len;
char **ep;
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
LOCK;
ep = __environ;
++ep;
UNLOCK;
+
+ return 0;
}
/* The `clearenv' was planned to be added to POSIX.1 but probably