summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/random.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionstb2017-11-281-2/+2
| | | | | | | | with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
* Prefer _MUTEX_*LOCK over _THREAD_PRIVATE_MUTEX_*LOCK() when thread-specificguenther2016-04-051-4/+4
| | | | | | data isn't necessary. ok mpi@, ok&tweak natano@
* Move to the <limits.h> universe.deraadt2015-01-161-4/+1
| | | | review by millert, binary checking process with doug, concept with guenther
* typo; ok deraadtsthen2014-12-161-2/+2
|
* warn for correct symbolderaadt2014-12-161-2/+2
|
* improve warnings from rand_r(), rand(), and random()libressl-v2.1.2deraadt2014-12-091-1/+6
| | | | | It may take a few iterations to get the tone right. previously discussed with millert
* Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()deraadt2014-12-081-35/+14
| | | | | | | | | | | | | | | | | to returning strong random by default, source from arc4random(3). Parameters to the seeding functions are ignored, and the subsystems remain in strong random mode. If you wish the standardized deterministic mode, call srand_deterministic(), srandom_determistic(), srand48_deterministic(), seed48_deterministic() or lcong48_deterministic() instead. The re-entrant functions rand_r(), erand48(), nrand48(), jrand48() are unaffected by this change and remain in deterministic mode (for now). Verified as a good roadmap forward by auditing 8800 pieces of software. Roughly 60 pieces of software will need adaptation to request the deterministic mode. Violates POSIX and C89, which violate best practice in this century. ok guenther tedu millert
* remove unused variablechl2014-10-131-3/+1
| | | | ok tedu@
* once srandomdev() is called, switch to using arc4random() but mask off thetedu2014-07-131-12/+10
| | | | | high bit as required by posix. wouldn't want to break any standards. idea and ok deraadt
* oops, typo. James Hartley is fast at trying -currentderaadt2014-06-151-2/+2
|
* In srandomdev(), use arc4random_buf() instead of from the kernel.deraadt2014-06-151-4/+3
| | | | discussion with matthew
* use getentropy; from matthewderaadt2014-06-131-5/+2
|
* Add linker warnings for rand() and random() and various related functions.kettenis2013-08-011-1/+16
| | | | ok deraadt@
* threadsafe random().tedu2013-03-151-8/+43
| | | | reported by ajacoutot and (much earlier, sorry) by Alexey Suslikov
* Improve standards conformance: ecvt(), fcvt(), gcvt(), mktemp(), ttyslot(),guenther2012-06-011-2/+2
| | | | | | | and valloc() are not in the current version, while posix_memalign() mkstemp(), and mkdtemp() are, and setstate()'s argument has lost a bogus 'const'. ok millert@ jmc@ espie@ kettenis@; ports build testing by naddy@
* Fix a bug where random() always returns 0 when srandom() is seededmillert2012-03-211-2/+3
| | | | | with 0. Use 1 and not 0 as the first element of the state array, similar to what glibc does. OK nicm@
* Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a timeotto2005-11-301-38/+11
| | | | | | | and remove fallback code. If somebody is dumb enough to make the sysctl fail using systrace, he deserves what he gets. Saves 7 syscalls on process startup. looks good miod@ ok deraadt@ tedu@
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* ansi + de-registerpat2005-03-301-11/+6
| | | | ok otto deraadt
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Use int32_t, not long since this deals with 32bit quantities.millert2003-02-281-20/+20
| | | | Inspired by a change in NetBSD and reported by Jan Johansson.
* In srandomdev(), if we can't access /dev/arandom, use the sysctl() instead.millert2002-12-061-10/+27
| | | | | We don't want to use the sysctl() by default since we are reading more than just a few bytes of entropy when setting up the state.
* Fix the leak for real (that's what I get for hacking when i can't sleep).millert2000-04-041-5/+7
|
* Fix an fd leak if the read from /dev/arandom fails. Pointed out bymillert2000-04-041-5/+5
| | | | Markus Friedl.
* Add srandomdev() from FreeBSD for use by sendmail and others.millert2000-04-031-1/+46
|
* More XPG4.2 --millert1998-02-071-9/+5
| | | | | setstate takes a const parameter don't ever spew to stderr, just return NULL
* size_t n in initstate(); XPGderaadt1998-02-061-2/+2
|
* Remove dead codetholo1996-09-151-3/+2
| | | | | | Remove unused variables Silence some warnings lint(1) is your friend
* Fix RCS idstholo1996-08-191-2/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* Substantially improve random number generation by using the largest primetholo1996-03-301-9/+21
| | | | | that fits inside 32 bits as the denominator; take care not to overflow. Regenerate initial seed after replacing the generator
* initial import of NetBSD treederaadt1995-10-181-0/+364