1 .\" Copyright 2008 Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
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
28 .TH RANDOM_R 3 2008-03-07 "GNU" "Linux Programmer's Manual"
30 random_r, srandom_r, initstate_r, setstate_r \- リエントラントな
34 .B #include <stdlib.h>
36 .BI "int random_r(struct random_data *" buf ", int32_t *" result );
38 .BI "int srandom_r(unsigned int " seed ", struct random_data *" buf );
40 .BI "int initstate_r(unsigned int " seed ", char *" statebuf ,
41 .BI " size_t " statelen ", struct random_data *" buf );
43 .BI "int setstate_r(char *" statebuf ", struct random_data *" buf );
48 .RB ( feature_test_macros (7)
58 _SVID_SOURCE || _BSD_SOURCE
64 で説明されている関数のリエントラント版で、等価な機能を持つ。
65 これらは、独立した再現可能な乱数列を各スレッドが得る必要があるような
66 マルチスレッド・プログラムでの使用に適している。
72 大域変数 (global variable) で管理される状態情報を使うのではなく、
83 大域変数で管理される状態に対応する乱数生成器の種ではなく、
85 が指すオブジェクトで管理される状態に対応する乱数生成器の種を
91 と同様だが、大域変数で管理される状態を初期化するのではなく、
98 と同様だが、大域変数で管理される状態を変更するのではなく、
127 これらの関数は非標準で glibc による拡張である。
128 .\" These functions appear to be on Tru64, but don't seem to be on
129 .\" Solaris, HP-UX, or FreeBSD.