| Main index | Section 9 | Options |
#include <sys/prng.h>
For cryptographically secure random numbers generated by the random(4) kernel cryptographically secure random number generator subsystem, see arc4random(9).
| prng32() | |
| Generate a 32-bit integer uniformly distributed in [0, 2^32-1]. | |
| prng32_bounded(bound) | |
| Generate an integer uniformly in the range [0, bound-1]. | |
| prng64() | |
| Generate a 64-bit integer uniformly distributed in [0, 2^64-1]. | |
| prng64_bounded(bound) | |
| Generate an integer uniformly in the range [0, bound-1]. | |
These routines are not reentrant; they are not safe to use in interrupt handlers ("interrupt filters" in bus_setup_intr(9) terminology). They are safe to use in all other kernel contexts, including interrupt threads ("ithreads").
| PRNG (9) | August 5, 2020 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Never write it in C if you can do it in `awk'; Never do it in `awk' if `sed' can handle it; Never use `sed' when `tr' can do the job; Never invoke `tr' when `cat' is sufficient; Avoid using `cat' whenever possible. |
” |
| — Taylor's Laws of Programming | ||