summaryrefslogtreecommitdiff
path: root/lib/random_r.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* Update some URLsPaul Eggert2019-09-221-1/+1
| | | | | | This is a clerical change that mostly changes http: to https: in URLs where either will work. It also updates some URLs that have moved, removes some URLs that no longer work, and fixes related text.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* random_r: do not crash if state is unalignedPaul Eggert2018-06-211-20/+36
| | | | | | | | | | | | | | Problem reported by Bruce Korb in: https://lists.gnu.org/r/bug-gnulib/2018-06/msg00030.html I reproduced the crash on 32-bit sparc with Oracle Studio 12.6 with 'cc -O2 -xmemalign=8s'. * lib/random_r.c: Include string.h, for memcpy. (get_int32, set_int32): New functions. (__srandom_r, __initstate_r, __setstate_r, __random_r): Use them to avoid assumption that state pointer is aligned. (__random_r): Avoid integer overflow if INT_MAX == UINT32_MAX. * tests/test-random_r.c (test_failed): New function. (main): Use it, to test for alignment bugs.
* random_r: omit unnecessary includePaul Eggert2018-06-211-1/+0
| | | | * lib/random_r.c: Do not include limits.h.
* random, random_r: merge from glibcPaul Eggert2018-06-211-43/+33
| | | | | | | | | | | | | | | | | | | | | * lib/random.c, lib/random_r.c: Include libc-config.h if !_LIBC, not config.h unilaterally. * lib/random.c: Do not include stdint.h or time.h; not needed. Include libc-lock.h if _LIBC, and define substitute macros otherwise. (unsafe_state): Rename from generator. All uses changed. Use C99-style initializers. (__random, __srandom, __initstate, __setstate): Rename from non-underscored version, but define it to non-underscored version on Gnulib. Add a lock. * lib/random_r.c (__srandom_r, __initstate_r, __setstate_r, __random_r): Likewise. Do not include <stdint.h>; not needed since stdlib.h defines int32_t. (weak_alias, __set_errno) [!_LIBC]: Remove; now done by libc-config. (__srandom_r): Use int32_t instead of long int where int32_t will do. (__random_r): Use uint32 to fix glibc bug 17343. * modules/random, modules/random_r (Depends-on): Add libc-config. Depend on stdint only if $HAVE_RANDOM = 0.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* unsetenv etc.: port to Solaris 11 + GNU EmacsPaul Eggert2013-02-111-2/+2
| | | | | | | | | | | * lib/canonicalize-lgpl.c, lib/getaddrinfo.c, lib/getdelim.c: * lib/glob.c, lib/random_r.c, lib/setenv.c, lib/tsearch.c: * lib/unsetenv.c (_GL_ARG_NONNULL): Define before including <config.h>. GNU Emacs's <config.h> includes <stdlib.h> (which is not a great idea but is too painful to fix right now), and without this gnulib change <stdlib.h> was defining _GL_ARG_NONNULL incorrectly when compiling unsetenv.c on Solaris 11. Fix the problem for unsetenv.c, and fix other similar occurrences.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* random_r: Use common idioms.Bruno Haible2012-01-121-1/+3
| | | | * lib/random_r.c: Include <stdlib.h> first.
* random_r: Support for MSVC 9.Bruno Haible2012-01-121-1/+1
| | | | * lib/random_r.c: Include stdint.h, not inttypes.h.
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-1/+1
|
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* New module 'arg-nonnull'. Declare which arguments expect non-NULL values.Bruno Haible2009-12-111-1/+6
|
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-42/+42
|
* Use the standard header with GPL copyright.Bruno Haible2009-09-171-12/+10
|
* random_r: new moduleJim Meyering2008-10-231-0/+420
* modules/random_r: New file. * m4/random_r.m4: New file. * lib/random_r.c: New file, from glibc. * modules/random_r-tests: New file. * tests/test-random_r.c: New file. * lib/stdlib.in.h (srandom_r, initstate_r, setstate_r, random_r): Declare. (RAND_MAX): Define. * m4/stdlib_h.m4: Define and AC_SUBST GNULIB_RANDOM_R and HAVE_RANDOM_R. * modules/stdlib: Substitute them, too. * MODULES.html.sh (Extra functions based on POSIX:2001) [Misc]: Add it. * doc/glibc-functions/initstate_r.texi: Mention the new module. * doc/glibc-functions/random_r.texi: Likewise. * doc/glibc-functions/setstate_r.texi: Likewise. * doc/glibc-functions/srandom_r.texi: Likewise. * config/srclist.txt: Mention it.