share/mk/: Remove unused variable
[man-pages.git] / man3 / drand48_r.3
blob13f89324630b44afabd0a08556ddbe54511ac3ac
1 '\" t
2 .\" Copyright 2003 Walter Harms, 2004 Andries Brouwer <aeb@cwi.nl>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08
7 .\"
8 .TH drand48_r 3 (date) "Linux man-pages (unreleased)"
9 .SH NAME
10 drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r,
11 srand48_r, seed48_r, lcong48_r
12 \- generate uniformly distributed pseudo-random numbers reentrantly
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <stdlib.h>
20 .BI "int drand48_r(struct drand48_data *restrict " buffer ,
21 .BI "              double *restrict " result );
22 .BI "int erand48_r(unsigned short " xsubi [3] ","
23 .BI "              struct drand48_data *restrict "buffer ,
24 .BI "              double *restrict " result ");"
26 .BI "int lrand48_r(struct drand48_data *restrict " buffer ,
27 .BI "              long *restrict " result );
28 .BI "int nrand48_r(unsigned short " xsubi[3] ","
29 .BI "              struct drand48_data *restrict "buffer ,
30 .BI "              long *restrict " result ");"
32 .BI "int mrand48_r(struct drand48_data *restrict " buffer ,
33 .BI "              long *restrict " result ");"
34 .BI "int jrand48_r(unsigned short " xsubi[3] ","
35 .BI "              struct drand48_data *restrict " buffer ,
36 .BI "              long *restrict " result ");"
38 .BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");"
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 );
41 .fi
43 .RS -4
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
46 .RE
48 All functions shown above:
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 ():
58 .nf
59     /* glibc >= 2.19: */ _DEFAULT_SOURCE
60         || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
61 .fi
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 .
69 Before the first use, this struct must be initialized, for example,
70 by filling it with zeros, or by calling one of the functions
71 .BR srand48_r (),
72 .BR seed48_r (),
74 .BR lcong48_r ().
75 .SH RETURN VALUE
76 The return value is 0.
77 .SH ATTRIBUTES
78 For an explanation of the terms used in this section, see
79 .BR attributes (7).
80 .TS
81 allbox;
82 lbx lb lb
83 l l l.
84 Interface       Attribute       Value
86 .na
87 .nh
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 (),
96 .BR lcong48_r ()
97 T}      Thread safety   MT-Safe race:buffer
98 .TE
99 .SH STANDARDS
100 GNU.
101 .SH SEE ALSO
102 .BR drand48 (3),
103 .BR rand (3),
104 .BR random (3)