Debian Codegraph @

upstream/debian-unstable/man3/drand48_r.3

raw
1 '\" t
2 .\" Copyright 2003, Walter Harms <[email protected]>
3 .\" Copyright 2004, Andries E. Brouwer <[email protected]>
4 .\" Copyright, the authors of the Linux man-pages project
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\"
8 .TH drand48_r 3 2026-02-08 "Linux man-pages 6.18"
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>
19 .P
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 ");"
25 .P
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 ");"
31 .P
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 ");"
37 .P
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
42 .P
43 .RS -4
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
46 .RE
47 .P
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 .
68 .P
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 (),
73 or
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
85 T{
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)