1DRAND48_R(3)               Linux Programmer's Manual              DRAND48_R(3)
2
3
4

NAME

6       drand48_r,   erand48_r,  lrand48_r,  nrand48_r,  mrand48_r,  jrand48_r,
7       srand48_r, seed48_r, lcong48_r - generate uniformly distributed pseudo-
8       random numbers reentrantly
9

SYNOPSIS

11       #include <stdlib.h>
12
13       int drand48_r(struct drand48_data *restrict buffer,
14                     double *restrict result);
15       int erand48_r(unsigned short xsubi[3],
16                     struct drand48_data *restrict buffer,
17                     double *restrict result);
18
19       int lrand48_r(struct drand48_data *restrict buffer,
20                     long *restrict result);
21       int nrand48_r(unsigned short xsubi[3],
22                     struct drand48_data *restrict buffer,
23                     long *restrict result);
24
25       int mrand48_r(struct drand48_data *restrict buffer,
26                     long *restrict result);
27       int jrand48_r(unsigned short xsubi[3],
28                     struct drand48_data *restrict buffer,
29                     long *restrict result);
30
31       int srand48_r(long int seedval, struct drand48_data *buffer);
32       int seed48_r(unsigned short seed16v[3], struct drand48_data *buffer);
33       int lcong48_r(unsigned short param[7], struct drand48_data *buffer);
34
35   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
36
37       All functions shown above:
38           /* Glibc since 2.19: */ _DEFAULT_SOURCE
39               || /* Glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
40

DESCRIPTION

42       These functions are the reentrant analogs of the functions described in
43       drand48(3).  Instead of modifying the global  random  generator  state,
44       they use the supplied data buffer.
45
46       Before  the first use, this struct must be initialized, for example, by
47       filling it with zeros, or by calling one of the functions  srand48_r(),
48       seed48_r(), or lcong48_r().
49

RETURN VALUE

51       The return value is 0.
52

ATTRIBUTES

54       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
55       tributes(7).
56
57       ┌────────────────────────────────┬───────────────┬─────────────────────┐
58Interface                       Attribute     Value               
59       ├────────────────────────────────┼───────────────┼─────────────────────┤
60drand48_r(), erand48_r(),       │ Thread safety │ MT-Safe race:buffer │
61lrand48_r(), nrand48_r(),       │               │                     │
62mrand48_r(), jrand48_r(),       │               │                     │
63srand48_r(), seed48_r(),        │               │                     │
64lcong48_r()                     │               │                     │
65       └────────────────────────────────┴───────────────┴─────────────────────┘
66

CONFORMING TO

68       These functions are GNU extensions and are not portable.
69

SEE ALSO

71       drand48(3), rand(3), random(3)
72

COLOPHON

74       This page is part of release 5.12 of the Linux  man-pages  project.   A
75       description  of  the project, information about reporting bugs, and the
76       latest    version    of    this    page,    can     be     found     at
77       https://www.kernel.org/doc/man-pages/.
78
79
80
81GNU                               2021-03-22                      DRAND48_R(3)
Impressum