History log of /openbsd-current/lib/libc/stdlib/rand.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.18 28-Nov-2017 tb

GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections
with "warning: " since 2003, so the messages themselves need not
contain the prefix anymore.

From Scott Cheloha
ok jca, deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.17 22-Oct-2016 tb

$OpenBSD$


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.16 18-Dec-2015 tb

Simplify return call of rand() and rand_r() to make it easier to read.
This is slightly less robust, but RAND_MAX must be one below a power
of two in both variants anyway.

Based on a suggestion by Matthew Martin.

ok tedu@


# 1.15 13-Sep-2015 guenther

Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.14 16-Dec-2014 sthen

typo; ok deraadt


# 1.13 09-Dec-2014 deraadt

improve warnings from rand_r(), rand(), and random()
It may take a few iterations to get the tone right.
previously discussed with millert


# 1.12 08-Dec-2014 deraadt

Oops, got the sense of the test backwards. Hilarious that we didn't spot it.


# 1.11 08-Dec-2014 deraadt

Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()
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


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.10 01-Aug-2013 kettenis

Add linker warnings for rand() and random() and various related functions.

ok deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.9 08-Aug-2005 espie

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


# 1.8 30-Mar-2005 pat

ansi + de-register

ok otto deraadt


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.7 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.6 07-Dec-1998 millert

No need to cast to they type we already are. Also minor KNF


# 1.5 07-Dec-1998 millert

remove bogus divide, fixes pr #656


# 1.4 22-Nov-1998 deraadt

bad long


# 1.3 20-Nov-1998 d

Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
(more md stuff is needed for other libc/arch/*)
(setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.2 19-Aug-1996 tholo

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision