OSDN Git Service

cbc877c4647fefde21372b4d9122c104e70359be
[linuxjm/LDP_man-pages.git] / original / man3 / drand48_r.3
1 .\" Copyright 2003 Walter Harms, 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\"
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.
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Created 2004-10-31. Text taken from a page by Walter Harms, 2003-09-08
26 .\"
27 .TH DRAND48_R 3 2013-09-09 "GNU" "Linux Programmer's Manual"
28 .SH NAME
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
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
44 .BI "int nrand48_r(unsigned short int " xsubi[3] ","
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
56 .BI "int seed48_r(unsigned short int " seed16v[3] ","
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
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
71 All functions shown above:
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
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
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
92 .BR srand48_r (),
93 .BR seed48_r (),
94 or
95 .BR lcong48_r ().
96 .SH RETURN VALUE
97 The return value is 0.
98 .SH ATTRIBUTES
99 .SS Multithreading (see pthreads(7))
100 The
101 .BR drand48_r (),
102 .BR erand48_r (),
103 .BR lrand48_r (),
104 .BR nrand48_r (),
105 .BR mrand48_r (),
106 .BR jrand48_r (),
107 .BR srand48_r (),
108 .BR seed48_r (),
109 and
110 .BR lcong48_r ()
111 functions are thread-safe.
112 .SH CONFORMING TO
113 These functions are GNU extensions and are not portable.
114 .SH SEE ALSO
115 .BR drand48 (3),
116 .BR rand (3),
117 .BR random (3)
118 .SH COLOPHON
119 This page is part of release 3.67 of the Linux
120 .I man-pages
121 project.
122 A description of the project,
123 information about reporting bugs,
124 and the latest version of this page,
125 can be found at
126 \%http://www.kernel.org/doc/man\-pages/.