]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/drand48_r.3
dlinfo.3: ATTRIBUTES: Note function that is thread-safe
[thirdparty/man-pages.git] / man3 / drand48_r.3
CommitLineData
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 29drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r,
fea681da
MK
30srand48_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
66Feature Test Macro Requirements for glibc (see
67.BR feature_test_macros (7)):
68.in
69.sp
70.ad l
cfc2d88d 71All 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
84These functions are the reentrant analogs of the functions described in
85.BR drand48 (3).
86Instead of modifying the global random generator state, they use
87the supplied data
88.IR buffer .
89
75b94dc3 90Before the first use, this struct must be initialized, for example,
7b01461a 91by filling it with zeros, or by calling one of the functions
63aa9df0
MK
92.BR srand48_r (),
93.BR seed48_r (),
fea681da 94or
63aa9df0 95.BR lcong48_r ().
47297adb 96.SH RETURN VALUE
fea681da 97The return value is 0.
8cb0cd82 98.SH ATTRIBUTES
ffaf4916
MK
99For an explanation of the terms used in this section, see
100.BR attributes (7).
101.ad l
102.TS
103allbox;
5c753f32 104lbw25 lb lb
ffaf4916
MK
105l l l.
106Interface Attribute Value
107T{
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 117T} Thread safety MT-Safe race:buffer
ffaf4916
MK
118.TE
119.ad
47297adb 120.SH CONFORMING TO
fea681da 121These 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)