1 .\" Copyright 2003 Walter Harms, 2004 Andries Brouwer <aeb@cwi.nl>.
3 .\" %%%LICENSE_START(VERBATIM)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08
27 .TH DRAND48_R 3 2013-09-09 "GNU" "Linux Programmer's Manual"
29 drand48_r, erand48_r, lrand48_r, nrand48_r, mrand48_r, jrand48_r,
30 srand48_r, seed48_r, lcong48_r
31 \- generate uniformly distributed pseudo-random numbers reentrantly
34 .B #include <stdlib.h>
36 .BI "int drand48_r(struct drand48_data *" buffer ", double *" result );
38 .BI "int erand48_r(unsigned short " xsubi [3] ","
40 .BI " struct drand48_data *"buffer ", double *" result ");"
42 .BI "int lrand48_r(struct drand48_data *" buffer ", long int *" result );
44 .BI "int nrand48_r(unsigned short int " xsubi[3] ","
46 .BI " struct drand48_data *"buffer ", long int *" result ");"
48 .BI "int mrand48_r(struct drand48_data *" buffer ",long int *" result ");"
50 .BI "int jrand48_r(unsigned short int " xsubi[3] ","
52 .BI " struct drand48_data *" buffer ", long int *" result ");"
54 .BI "int srand48_r(long int " seedval ", struct drand48_data *" buffer ");"
56 .BI "int seed48_r(unsigned short int " seed16v[3] ","
58 .BI " struct drand48_data *" buffer ");"
60 .BI "int lcong48_r(unsigned short int " param[7] ","
62 .BI " struct drand48_data *" buffer ");"
66 Feature Test Macro Requirements for glibc (see
67 .BR feature_test_macros (7)):
71 All functions shown above:
81 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
84 These functions are the reentrant analogs of the functions described in
86 Instead of modifying the global random generator state, they use
90 Before the first use, this struct must be initialized, for example,
91 by filling it with zeros, or by calling one of the functions
97 The return value is 0.
99 .SS Multithreading (see pthreads(7))
111 functions are thread-safe.
113 These functions are GNU extensions and are not portable.