diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/getsubopt.c | 34 | ||||
-rw-r--r-- | stdlib/rand.c | 33 | ||||
-rw-r--r-- | stdlib/random_r.c | 1 | ||||
-rw-r--r-- | stdlib/stdlib.h | 6 |
4 files changed, 39 insertions, 35 deletions
diff --git a/stdlib/getsubopt.c b/stdlib/getsubopt.c index f5ecea4faa..fa9eb06c3e 100644 --- a/stdlib/getsubopt.c +++ b/stdlib/getsubopt.c @@ -1,22 +1,22 @@ -/* getsubopt -- parse comma separate list into words -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. +/* Parse comma separate list into words. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include <stdlib.h> #include <string.h> @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ optional value introduced by an equal sign. If the suboption is not part of TOKENS return in *VALUEP beginning of unknown suboption. On exit *OPTIONP is set to the beginning of the next - otken or at the terminating NUL character. */ + token or at the terminating NUL character. */ int getsubopt (optionp, tokens, valuep) char **optionp; diff --git a/stdlib/rand.c b/stdlib/rand.c index 1353432850..c80da71d7d 100644 --- a/stdlib/rand.c +++ b/stdlib/rand.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1996 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 -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include <ansidecl.h> #include <stdlib.h> #undef rand @@ -24,7 +23,7 @@ Cambridge, MA 02139, USA. */ /* Return a random integer between 0 and RAND_MAX. */ int -DEFUN_VOID(rand) +rand () { - return (int) __random(); + return (int) __random (); } diff --git a/stdlib/random_r.c b/stdlib/random_r.c index 8c516780cd..823075bfc3 100644 --- a/stdlib/random_r.c +++ b/stdlib/random_r.c @@ -154,7 +154,6 @@ __srandom_r (x, buf) } weak_alias (__srandom_r, srandom_r) -weak_alias (__srandom_r, srand_r) /* Initialize the state information in the given array of N bytes for future random number generation. Based on the number of bytes we diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index e741f492c6..9e08d81c77 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -265,6 +265,12 @@ extern int rand __P ((void)); /* Seed the random number generator with the given number. */ extern void srand __P ((unsigned int __seed)); +#ifdef __USE_REENTRANT +/* Reentrant interface according to POSIX.1. */ +extern int __rand_r __P ((unsigned int *__seed)); +extern int rand_r __P ((unsigned int *__seed)); +#endif + #if defined(__USE_SVID) || defined(__USE_XOPEN) /* System V style 48-bit random number generator functions. */ |