OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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 _SVID_SOURCE || _BSD_SOURCE
58 .ad b
59 .SH ÀâÌÀ
60 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢
61 .BR random (3)
62 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǡ¢Åù²Á¤Êµ¡Ç½¤ò»ý¤Ä¡£
63 ¤³¤ì¤é¤Ï¡¢ÆÈΩ¤·¤¿ºÆ¸½²Äǽ¤ÊÍð¿ôÎó¤ò³Æ¥¹¥ì¥Ã¥É¤¬ÆÀ¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê
64 ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦¥×¥í¥°¥é¥à¤Ç¤Î»ÈÍѤËŬ¤·¤Æ¤¤¤ë¡£
65
66 .BR random_r ()
67 ´Ø¿ô¤Ï
68 .BR random (3)
69 ¤ÈƱÍͤÀ¤¬¡¢
70 Âç°èÊÑ¿ô (global variable) ¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¾ðÊó¤ò»È¤¦¤Î¤Ç¤Ï¤Ê¤¯¡¢
71 .I buf
72 ¤¬»Ø¤¹°ú¤­¿ô¤Ë³ÊǼ¤µ¤ì¤¿¾õÂÖ¾ðÊó¤ò»È¤¦¡£
73 À¸À®¤µ¤ì¤¿Íð¿ô¤Ï°ú¤­¿ô
74 .I result
75 ¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£
76
77 .BR srandom_r ()
78 ´Ø¿ô¤Ï
79 .BR srandom (3)
80 ¤ÈƱÍͤÀ¤¬¡¢
81 Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤Ç¤Ï¤Ê¤¯¡¢
82 .I buf
83 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥È¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ËÂбþ¤¹¤ëÍð¿ôÀ¸À®´ï¤Î¼ï¤ò
84 ½é´ü²½¤¹¤ë¡£
85
86 .BR initstate_r ()
87 ´Ø¿ô¤Ï
88 .BR initstate (3)
89 ¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤ò½é´ü²½¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
90 .I buf
91 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤ò½é´ü²½¤¹¤ë¡£
92
93 .BR setstate_r ()
94 ´Ø¿ô¤Ï
95 .BR setstate (3)
96 ¤ÈƱÍͤÀ¤¬¡¢Âç°èÊÑ¿ô¤Ç´ÉÍý¤µ¤ì¤ë¾õÂÖ¤òÊѹ¹¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
97 .I buf
98 ¤¬»Ø¤¹¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Î¾õÂÖ¤òÊѹ¹¤¹¤ë¡£
99 .SH ÊÖ¤êÃÍ
100 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢
101 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤¹¡£
102 .SH ¥¨¥é¡¼
103 .TP
104 .B EINVAL
105 8 ¥Ð¥¤¥È¤è¤ê¾®¤µ¤¤¾õÂÖÇÛÎó¤¬
106 .BR initstate_r ()
107 ¤Ë»ØÄꤵ¤ì¤¿¡£
108 .TP
109 .B EINVAL
110 .BR setstate_r ()
111 ¤Î°ú¤­¿ô
112 .I statebuf
113 ¤«
114 .I buf
115 ¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£
116 .TP
117 .B EINVAL
118 .BR random_r ()
119 ¤Î°ú¤­¿ô
120 .I buf
121 ¤«
122 .I result
123 ¤¬ NULL ¤Ç¤¢¤Ã¤¿¡£
124 .SH ½àµò
125 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç glibc ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
126 .\" These functions appear to be on Tru64, but don't seem to be on
127 .\" Solaris, HP-UX, or FreeBSD.
128 .SH ´ØÏ¢¹àÌÜ
129 .BR drand48 (3),
130 .BR rand (3),
131 .BR random (3)