|
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0 |
|
| #
8a16b7a1 |
| 20-Nov-2017 |
Pedro F. Giffuni <[email protected]> |
General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier f
General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
show more ...
|
|
Revision tags: release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0 |
|
| #
44f87738 |
| 29-May-2016 |
Andrey A. Chernov <[email protected]> |
1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard.
2) Instead of doing range transformation in each and every function here, do it single time directly in do_ran
1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard.
2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones.
3) Use POSIX argument types for visible functions (cosmetic).
MFC after: 1 week
show more ...
|
| #
2cf5e936 |
| 18-Apr-2016 |
Andriy Voskoboinyk <[email protected]> |
libc: do not include <sys/types.h> where <sys/param.h> was already included
According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <
libc: do not include <sys/types.h> where <sys/param.h> was already included
According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined).
show more ...
|
|
Revision tags: release/10.3.0 |
|
| #
f98e0c9d |
| 20-Sep-2015 |
Craig Rodrigues <[email protected]> |
Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
|
|
Revision tags: release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0 |
|
| #
61762e7d |
| 04-Jul-2013 |
Andrey A. Chernov <[email protected]> |
Style fix noted by bde@
|
| #
7d815fd5 |
| 04-Jul-2013 |
Andrey A. Chernov <[email protected]> |
After fixing ranges restore POSIX requirement: rand() call without srand() must be the same as srand(1); rand(); (yet one increment)
|
| #
df5c65e2 |
| 03-Jul-2013 |
Andrey A. Chernov <[email protected]> |
In addition to prev. commit, for repeated rand_r(3) calls don't forget to compensate back at the end incremented at the start internal state.
MFC after: 2 weeks
|
| #
476d9314 |
| 03-Jul-2013 |
Andrey A. Chernov <[email protected]> |
1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range, but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is n
1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range, but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached because it is off by one, zero is not reached too.
Correct both RAND_MAX and rand(3) return value, shifting last one to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] range.
2) Add a checks for not overflowing on too big seeds. It may happens on the machines, where sizeof(unsigned int) > 32 bits.
Reviewed by: bde [1] MFC after: 2 weeks
show more ...
|
| #
580b4d18 |
| 13-Jun-2013 |
Ed Maste <[email protected]> |
Renumber clauses to reduce diffs to other versions
NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier.
|
|
Revision tags: release/8.4.0 |
|
| #
12a68650 |
| 02-Apr-2013 |
Xin LI <[email protected]> |
Replace access to /dev/random with the kernel pseudo-random number source sysctl(KERN_ARND) and remove the fallback code.
Obtained from: OpenBSD Reviewed by: secteam MFC after: 1 month
|
|
Revision tags: release/9.1.0 |
|
| #
6a762eb2 |
| 09-Oct-2012 |
Eitan Adler <[email protected]> |
Remove undefined behavior from sranddev() and srandomdev(). This doesn't actually work with any modern C compiler:
In particular, both clang and modern gcc verisons silently elide any xor operation
Remove undefined behavior from sranddev() and srandomdev(). This doesn't actually work with any modern C compiler:
In particular, both clang and modern gcc verisons silently elide any xor operation with 'junk'.
Approved by: secteam MFC after: 3 days
show more ...
|
| #
05eb11cb |
| 29-Sep-2012 |
Jilles Tjoelker <[email protected]> |
libc: Use O_CLOEXEC for various internal file descriptors.
This fixes a race condition where another thread may fork() before CLOEXEC is set, unintentionally passing the descriptor to the child proc
libc: Use O_CLOEXEC for various internal file descriptors.
This fixes a race condition where another thread may fork() before CLOEXEC is set, unintentionally passing the descriptor to the child process.
This commit only adds O_CLOEXEC flags to open() or openat() calls where no fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still leaves a race window so it should be fixed later.
show more ...
|
|
Revision tags: release/8.3.0, release/7.4.0, release/8.2.0, release/8.1.0, release/7.3.0, release/8.0.0, release/7.2.0, release/7.1.0, release/6.4.0, release/7.0.0, release/6.3.0 |
|
| #
192b5193 |
| 11-Dec-2007 |
Andrey A. Chernov <[email protected]> |
Fix typo in the comment
|
|
Revision tags: release/6.2.0 |
|
| #
c879ae35 |
| 09-Jan-2007 |
Warner Losh <[email protected]> |
Per Regents of the University of Calfornia letter, remove advertising clause.
# If I've done so improperly on a file, please let me know.
|
|
Revision tags: release/5.5.0, release/6.1.0, release/6.0.0, release/5.4.0, release/4.11.0, release/5.3.0, release/4.10.0, release/5.2.1, release/5.2.0, release/4.9.0, release/5.1.0, release/4.8.0 |
|
| #
49abb2a4 |
| 17-Feb-2003 |
Andrey A. Chernov <[email protected]> |
Back out "drop first N values" method of removing monotonically increased seed->first value correlation. It breaks rand_r()... Other possible methods like shuffling inside aray will breaks rand_r() t
Back out "drop first N values" method of removing monotonically increased seed->first value correlation. It breaks rand_r()... Other possible methods like shuffling inside aray will breaks rand_r() too, because it assumes only one word state, i.e. nothing extra can be added after seed assignment in srand().
BTW, for old formulae seed->first value correlation is not so monotonically increased as with other Linear Congruential Generators of this type only becase arithmetic overflow happens. But overflow affects distribution and lower bits very badly, as many articles says, such type of overflow not improves PRNG.
So, monotonically increased seed->first value correlation problem remains...
show more ...
|
| #
f3047249 |
| 05-Feb-2003 |
Andrey A. Chernov <[email protected]> |
Since we drop NSHUFF values now, set default seed to what it becomes after srand(1)
|
| #
ddd972a9 |
| 04-Feb-2003 |
Andrey A. Chernov <[email protected]> |
For rand(3) and random(3) TYPE_0 drop NSHUFF values right after srand{om}() to remove part of seed -> 1st value correlation. Correlation still remains because of algorithm limits. Note that old algor
For rand(3) and random(3) TYPE_0 drop NSHUFF values right after srand{om}() to remove part of seed -> 1st value correlation. Correlation still remains because of algorithm limits. Note that old algorithm have even stronger correlation, especially in the lower bits area, but not eye-visible, as current one.
show more ...
|
| #
2f5ef51d |
| 03-Feb-2003 |
Andrey A. Chernov <[email protected]> |
Park & Miller PRNG can be safely initialized with any value but 0 and stuck at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not wo
Park & Miller PRNG can be safely initialized with any value but 0 and stuck at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not works since 2147483647 seed returns to 0 again on the next interation. Instead of after calculation mapping, map 0 to another value _before_ calculation, so it never stucks.
show more ...
|
| #
62c4150e |
| 02-Feb-2003 |
Andrey A. Chernov <[email protected]> |
For some combinations of variable sizes and RAND_MAX value rand_r() may store less amount bits for seed, than available. Fix it.
|
|
Revision tags: release/5.0.0 |
|
| #
2b6839cf |
| 03-Jan-2003 |
Tim J. Robbins <[email protected]> |
Add missing #include "namespace.h".
|
|
Revision tags: release/4.6.2 |
|
| #
333fc21e |
| 22-Mar-2002 |
David E. O'Brien <[email protected]> |
Fix the style of the SCM ID's. I believe have made all of libc .c's as consistent as possible.
|
| #
724641c6 |
| 30-Oct-2001 |
Mark Murray <[email protected]> |
Add a long-overdue nail to the deprecated /dev/urandom interface by asking some things that need unpredictable numbers to read /dev/random instead.
|
| #
a7d81577 |
| 07-Jun-2001 |
Dima Dorfman <[email protected]> |
urandom(4) -> random(4) in comments.
PR: 27858 Submitted by: Yoshihiro Koya <[email protected]> Reviewed by: md5(1) Approved by: markm
|
| #
4890ae81 |
| 23-Apr-2001 |
Andrey A. Chernov <[email protected]> |
Add #include "un-namespace.h"
|
| #
848422bb |
| 23-Apr-2001 |
Andrey A. Chernov <[email protected]> |
srand*dev() fallback code: change ^getpid() to ^(getpid() << 16) to allow change of high word part too to produce more interesting seed distribution.
|