]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright 2003 Walter Harms, 2004 Andries Brouwer <aeb@cwi.nl>. |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
5 | .\" |
6 | .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08 | |
7 | .\" | |
4c1c5274 | 8 | .TH drand48_r 3 (date) "Linux man-pages (unreleased)" |
fea681da | 9 | .SH NAME |
c13182ef | 10 | drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, |
fea681da MK |
11 | srand48_r, seed48_r, lcong48_r |
12 | \- generate uniformly distributed pseudo-random numbers reentrantly | |
b813014f AC |
13 | .SH LIBRARY |
14 | Standard C library | |
15 | .RI ( libc ", " \-lc ) | |
fea681da MK |
16 | .SH SYNOPSIS |
17 | .nf | |
18 | .B #include <stdlib.h> | |
68e4db0a | 19 | .PP |
f6ce9b1d AC |
20 | .BI "int drand48_r(struct drand48_data *restrict " buffer , |
21 | .BI " double *restrict " result ); | |
fea681da | 22 | .BI "int erand48_r(unsigned short " xsubi [3] "," |
f6ce9b1d AC |
23 | .BI " struct drand48_data *restrict "buffer , |
24 | .BI " double *restrict " result ");" | |
68e4db0a | 25 | .PP |
f6ce9b1d AC |
26 | .BI "int lrand48_r(struct drand48_data *restrict " buffer , |
27 | .BI " long *restrict " result ); | |
ae85f653 | 28 | .BI "int nrand48_r(unsigned short " xsubi[3] "," |
f6ce9b1d AC |
29 | .BI " struct drand48_data *restrict "buffer , |
30 | .BI " long *restrict " result ");" | |
68e4db0a | 31 | .PP |
f6ce9b1d AC |
32 | .BI "int mrand48_r(struct drand48_data *restrict " buffer , |
33 | .BI " long *restrict " result ");" | |
ae85f653 | 34 | .BI "int jrand48_r(unsigned short " xsubi[3] "," |
f6ce9b1d AC |
35 | .BI " struct drand48_data *restrict " buffer , |
36 | .BI " long *restrict " result ");" | |
68e4db0a | 37 | .PP |
fea681da | 38 | .BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" |
f6ce9b1d AC |
39 | .BI "int seed48_r(unsigned short " seed16v[3] ", struct drand48_data *" buffer ); |
40 | .BI "int lcong48_r(unsigned short " param[7] ", struct drand48_data *" buffer ); | |
fea681da | 41 | .fi |
68e4db0a | 42 | .PP |
d39ad78f | 43 | .RS -4 |
cc4615cc MK |
44 | Feature Test Macro Requirements for glibc (see |
45 | .BR feature_test_macros (7)): | |
d39ad78f | 46 | .RE |
68e4db0a | 47 | .PP |
cfc2d88d | 48 | All functions shown above: |
cc4615cc MK |
49 | .\" .BR drand48_r (), |
50 | .\" .BR erand48_r (), | |
51 | .\" .BR lrand48_r (), | |
52 | .\" .BR nrand48_r (), | |
53 | .\" .BR mrand48_r (), | |
54 | .\" .BR jrand48_r (), | |
55 | .\" .BR srand48_r (), | |
56 | .\" .BR seed48_r (), | |
57 | .\" .BR lcong48_r (): | |
9d2adbae | 58 | .nf |
75c018a1 AC |
59 | /* glibc >= 2.19: */ _DEFAULT_SOURCE |
60 | || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE | |
9d2adbae | 61 | .fi |
fea681da MK |
62 | .SH DESCRIPTION |
63 | These functions are the reentrant analogs of the functions described in | |
64 | .BR drand48 (3). | |
65 | Instead of modifying the global random generator state, they use | |
66 | the supplied data | |
67 | .IR buffer . | |
847e0d88 | 68 | .PP |
75b94dc3 | 69 | Before the first use, this struct must be initialized, for example, |
7b01461a | 70 | by filling it with zeros, or by calling one of the functions |
63aa9df0 MK |
71 | .BR srand48_r (), |
72 | .BR seed48_r (), | |
fea681da | 73 | or |
63aa9df0 | 74 | .BR lcong48_r (). |
47297adb | 75 | .SH RETURN VALUE |
fea681da | 76 | The return value is 0. |
8cb0cd82 | 77 | .SH ATTRIBUTES |
ffaf4916 MK |
78 | For an explanation of the terms used in this section, see |
79 | .BR attributes (7). | |
ffaf4916 MK |
80 | .TS |
81 | allbox; | |
c466875e | 82 | lbx lb lb |
ffaf4916 MK |
83 | l l l. |
84 | Interface Attribute Value | |
85 | T{ | |
9e54434e BR |
86 | .na |
87 | .nh | |
8cb0cd82 PH |
88 | .BR drand48_r (), |
89 | .BR erand48_r (), | |
90 | .BR lrand48_r (), | |
91 | .BR nrand48_r (), | |
92 | .BR mrand48_r (), | |
93 | .BR jrand48_r (), | |
94 | .BR srand48_r (), | |
95 | .BR seed48_r (), | |
8cb0cd82 | 96 | .BR lcong48_r () |
08d587a0 | 97 | T} Thread safety MT-Safe race:buffer |
ffaf4916 | 98 | .TE |
c466875e | 99 | .sp 1 |
3113c7f3 | 100 | .SH STANDARDS |
4131356c | 101 | GNU. |
47297adb | 102 | .SH SEE ALSO |
fea681da MK |
103 | .BR drand48 (3), |
104 | .BR rand (3), | |
105 | .BR random (3) |