]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2003 Walter Harms, 2004 Andries Brouwer <aeb@cwi.nl>. |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08 | |
26 | .\" | |
fe0fefbf | 27 | .TH DRAND48_R 3 2015-03-02 "GNU" "Linux Programmer's Manual" |
fea681da | 28 | .SH NAME |
c13182ef | 29 | drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r, |
fea681da MK |
30 | srand48_r, seed48_r, lcong48_r |
31 | \- generate uniformly distributed pseudo-random numbers reentrantly | |
32 | .SH SYNOPSIS | |
33 | .nf | |
34 | .B #include <stdlib.h> | |
35 | .sp | |
36 | .BI "int drand48_r(struct drand48_data *" buffer ", double *" result ); | |
37 | .sp | |
38 | .BI "int erand48_r(unsigned short " xsubi [3] "," | |
39 | .br | |
40 | .BI " struct drand48_data *"buffer ", double *" result ");" | |
41 | .sp | |
42 | .BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result ); | |
43 | .sp | |
c13182ef | 44 | .BI "int nrand48_r(unsigned short int " xsubi[3] "," |
fea681da MK |
45 | .br |
46 | .BI " struct drand48_data *"buffer ", long int *" result ");" | |
47 | .sp | |
48 | .BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");" | |
49 | .sp | |
50 | .BI "int jrand48_r(unsigned short int " xsubi[3] "," | |
51 | .br | |
52 | .BI " struct drand48_data *" buffer ", long int *" result ");" | |
53 | .sp | |
54 | .BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");" | |
55 | .sp | |
c13182ef | 56 | .BI "int seed48_r(unsigned short int " seed16v[3] "," |
fea681da MK |
57 | .br |
58 | .BI " struct drand48_data *" buffer ");" | |
59 | .sp | |
60 | .BI "int lcong48_r(unsigned short int " param[7] "," | |
61 | .br | |
62 | .BI " struct drand48_data *" buffer ");" | |
63 | .fi | |
cc4615cc MK |
64 | .sp |
65 | .in -4n | |
66 | Feature Test Macro Requirements for glibc (see | |
67 | .BR feature_test_macros (7)): | |
68 | .in | |
69 | .sp | |
70 | .ad l | |
cfc2d88d | 71 | All functions shown above: |
cc4615cc MK |
72 | .\" .BR drand48_r (), |
73 | .\" .BR erand48_r (), | |
74 | .\" .BR lrand48_r (), | |
75 | .\" .BR nrand48_r (), | |
76 | .\" .BR mrand48_r (), | |
77 | .\" .BR jrand48_r (), | |
78 | .\" .BR srand48_r (), | |
79 | .\" .BR seed48_r (), | |
80 | .\" .BR lcong48_r (): | |
81 | _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE | |
82 | .ad b | |
fea681da MK |
83 | .SH DESCRIPTION |
84 | These functions are the reentrant analogs of the functions described in | |
85 | .BR drand48 (3). | |
86 | Instead of modifying the global random generator state, they use | |
87 | the supplied data | |
88 | .IR buffer . | |
89 | ||
75b94dc3 | 90 | Before the first use, this struct must be initialized, for example, |
7b01461a | 91 | by filling it with zeros, or by calling one of the functions |
63aa9df0 MK |
92 | .BR srand48_r (), |
93 | .BR seed48_r (), | |
fea681da | 94 | or |
63aa9df0 | 95 | .BR lcong48_r (). |
47297adb | 96 | .SH RETURN VALUE |
fea681da | 97 | The return value is 0. |
8cb0cd82 | 98 | .SH ATTRIBUTES |
ffaf4916 MK |
99 | For an explanation of the terms used in this section, see |
100 | .BR attributes (7). | |
101 | .ad l | |
102 | .TS | |
103 | allbox; | |
5c753f32 | 104 | lbw25 lb lb |
ffaf4916 MK |
105 | l l l. |
106 | Interface Attribute Value | |
107 | T{ | |
8cb0cd82 PH |
108 | .BR drand48_r (), |
109 | .BR erand48_r (), | |
110 | .BR lrand48_r (), | |
111 | .BR nrand48_r (), | |
112 | .BR mrand48_r (), | |
113 | .BR jrand48_r (), | |
114 | .BR srand48_r (), | |
115 | .BR seed48_r (), | |
8cb0cd82 | 116 | .BR lcong48_r () |
08d587a0 | 117 | T} Thread safety MT-Safe race:buffer |
ffaf4916 MK |
118 | .TE |
119 | .ad | |
47297adb | 120 | .SH CONFORMING TO |
fea681da | 121 | These functions are GNU extensions and are not portable. |
47297adb | 122 | .SH SEE ALSO |
fea681da MK |
123 | .BR drand48 (3), |
124 | .BR rand (3), | |
125 | .BR random (3) |