OSDN Git Service

(split) Fixed #25191 (typo in fenv.3).
[linuxjm/LDP_man-pages.git] / release / man3 / random_r.3
1 .\" Copyright 2008 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
24 .\"         all rights reserved.
25 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.04
26 .\" 
27 .\"
28 .TH RANDOM_R 3  2008-03-07 "GNU" "Linux Programmer's Manual"
29 .SH Ì¾Á°
30 random_r, srandom_r, initstate_r, setstate_r \- ¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê
31 Íð¿ôÀ¸À®´ï
32 .SH ½ñ¼°
33 .nf
34 .B #include <stdlib.h>
35 .sp
36 .BI "int random_r(struct random_data *" buf ", int32_t *" result );
37
38 .BI "int srandom_r(unsigned int " seed ", struct random_data *" buf );
39
40 .BI "int initstate_r(unsigned int " seed ", char *" statebuf ,
41 .BI "                size_t " statelen ", struct random_data *" buf );
42 .br
43 .BI "int setstate_r(char *" statebuf ", struct random_data *" buf );
44 .fi
45 .sp
46 .in -4n
47 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
48 .RB ( feature_test_macros (7)
49 »²¾È):
50 .in
51 .sp
52 .ad l
53 .BR random_r (),
54 .BR srandom_r (),
55 .BR initstate_r (),
56 .BR setstate_r ():
57 .RS 4
58 _SVID_SOURCE || _BSD_SOURCE
59 .RE
60 .ad b
61 .SH ÀâÌÀ
62 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢
63 .BR random (3)
64 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢Åù²Á¤Êµ¡Ç½¤ò»ý¤Ä¡£
65 ¤³¤ì¤é¤Ï¡¢ÆÈΩ¤·¤¿ºÆ¸½²Äǽ¤ÊÍð¿ôÎó¤ò³Æ¥¹¥ì¥Ã¥É¤¬ÆÀ¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê
66 ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥à¤Ç¤Î»ÈÍѤËŬ¤·¤Æ¤¤¤ë¡£
67
68 .BR random_r ()
69 ´Ø¿ô¤Ï
70 .BR random (3)
71 ¤ÈƱÍͤÀ¤¬¡¢
72 Âç°èÊÑ¿ô (global variable) ¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¾ðÊó¤ò»È¤¦¤Î¤Ç¤Ï¤Ê¤¯¡¢
73 .I buf
74 ¤¬»Ø¤¹°ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤¿¾õÂÖ¾ðÊó¤ò»È¤¦¡£
75 À¸À®¤µ¤ì¤¿Íð¿ô¤Ï°ú¤­¿ô
76 .I result
77 ¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£
78
79 .BR srandom_r ()
80 ´Ø¿ô¤Ï
81 .BR srandom (3)
82 ¤ÈƱÍͤÀ¤¬¡¢
83 Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤Ç¤Ï¤Ê¤¯¡¢
84 .I buf
85 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤ò
86 ½é´ü²½¤¹¤ë¡£
87
88 .BR initstate_r ()
89 ´Ø¿ô¤Ï
90 .BR initstate (3)
91 ¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ò½é´ü²½¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
92 .I buf
93 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤ò½é´ü²½¤¹¤ë¡£
94
95 .BR setstate_r ()
96 ´Ø¿ô¤Ï
97 .BR setstate (3)
98 ¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤òÊѹ¹¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
99 .I buf
100 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¡£
101 .SH ÊÖ¤êÃÍ
102 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢
103 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£
104 .SH ¥¨¥é¡¼
105 .TP
106 .B EINVAL
107 8 ¥Ð¥¤¥È¤è¤ê¾®¤µ¤¤¾õÂÖÇÛÎó¤¬
108 .BR initstate_r ()
109 ¤Ë»ØÄꤵ¤ì¤¿¡£
110 .TP
111 .B EINVAL
112 .BR setstate_r ()
113 ¤Î°ú¤­¿ô
114 .I statebuf
115 ¤«
116 .I buf
117 ¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£
118 .TP
119 .B EINVAL
120 .BR random_r ()
121 ¤Î°ú¤­¿ô
122 .I buf
123 ¤«
124 .I result
125 ¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£
126 .SH ½àµò
127 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç glibc ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
128 .\" These functions appear to be on Tru64, but don't seem to be on
129 .\" Solaris, HP-UX, or FreeBSD.
130 .SH ´ØÏ¢¹àÌÜ
131 .BR drand48 (3),
132 .BR rand (3),
133 .BR random (3)