aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-27 07:07:07 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-27 07:07:07 +0000
commit61f9d0a356f84837e3e3af27831ec7d8070f15b7 (patch)
tree3eaa1888ecc0b91db26832062d4c6f42f05202ca /stdlib
parent69bd45bdbd422fadce2bd7a49db0f0adfb3ea9a2 (diff)
downloadglibc-61f9d0a356f84837e3e3af27831ec7d8070f15b7.tar
glibc-61f9d0a356f84837e3e3af27831ec7d8070f15b7.tar.gz
glibc-61f9d0a356f84837e3e3af27831ec7d8070f15b7.tar.bz2
glibc-61f9d0a356f84837e3e3af27831ec7d8070f15b7.zip
Update.
* 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.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/random.c2
-rw-r--r--stdlib/stdlib.h11
2 files changed, 7 insertions, 6 deletions
diff --git a/stdlib/random.c b/stdlib/random.c
index 06a4c97829..afd0a1a516 100644
--- a/stdlib/random.c
+++ b/stdlib/random.c
@@ -259,7 +259,7 @@ weak_alias (__setstate, setstate)
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;
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 17f19ac8d6..9b5d187558 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -395,7 +395,7 @@ extern long int a64l (__const char *__s) __THROW __attribute_pure__;
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;
@@ -554,7 +554,7 @@ extern void *valloc (size_t __size) __THROW __attribute_malloc__;
#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
@@ -600,14 +600,14 @@ extern char *__secure_getenv (__const char *__name) __THROW;
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
@@ -742,6 +742,8 @@ extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
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;
@@ -750,7 +752,6 @@ extern char *qfcvt (long double __value, int __ndigit,
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,