summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/random.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a long-overdue nail to the deprecated /dev/urandom interfaceMark Murray2001-10-301-1/+1
| | | | | | | | by asking some things that need unpredictable numbers to read /dev/random instead. Notes: svn path=/head/; revision=85752
* urandom(4) -> random(4) in comments.Dima Dorfman2001-06-071-1/+1
| | | | | | | | | | PR: 27858 Submitted by: Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp> Reviewed by: md5(1) Approved by: markm Notes: svn path=/head/; revision=77851
* srand*dev() fallback code: change ^getpid() to ^(getpid() << 16) to allowAndrey A. Chernov2001-04-231-1/+1
| | | | | | | change of high word part too to produce more interesting seed distribution. Notes: svn path=/head/; revision=75862
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch Notes: svn path=/head/; revision=71579
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),Jason Evans2000-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen Notes: svn path=/head/; revision=56698
* Add three-tier symbol naming in support of POSIX thread cancellationJason Evans2000-01-121-3/+3
| | | | | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read(). Notes: svn path=/head/; revision=55837
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* srandomdev: use stack junk value in the fallback code tooAndrey A. Chernov1997-06-151-2/+3
| | | | Notes: svn path=/head/; revision=26665
* Instead of copying fallback code over and over in each program,Andrey A. Chernov1997-06-141-9/+16
| | | | | | | | | implement (better) falback code inside srandomdev() itself. Change return type from int to void (binary compatibility surprisely achieved). Userland code will be changed soon. Notes: svn path=/head/; revision=26624
* Remove orand* code as promised for the next releaseAndrey A. Chernov1997-03-291-8/+3
| | | | Notes: svn path=/head/; revision=24390
* Fix urandom reference in the commentAndrey A. Chernov1997-03-231-1/+1
| | | | Notes: svn path=/head/; revision=24154
* Add srandomdev() function (use "/dev/urandom" now)Andrey A. Chernov1997-03-231-0/+40
| | | | | | | Submitted by: wollman & me (add type casts and remove unneded loop) Notes: svn path=/head/; revision=24151
* Merge Lite2 changesPeter Wemm1997-03-111-30/+68
| | | | Notes: svn path=/head/; revision=23662
* Improve seeding, the random sequence did not vary matchAndrey A. Chernov1996-10-091-5/+55
| | | | | | | with the seed. Old variant will be available via libcompat soon. Notes: svn path=/head/; revision=18832
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8870
* u_int -> unsigned int, so that we don't have to include <sys/types.h>Bruce Evans1994-09-051-2/+2
| | | | | | | or depend on <stdio.h> bogusly including it. Notes: svn path=/head/; revision=2504
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+363
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573