mirror of https://github.com/mkerrisk/man-pages
random_r.3: Note that 'buf' records a pointer to 'statebuf'
See https://sourceware.org/bugzilla/show_bug.cgi?id=3662. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
a689fdb223
commit
516a39595e
|
@ -97,6 +97,23 @@ rather than initializing the global state variable.
|
|||
Before calling this function, the
|
||||
.IR buf.state
|
||||
field must be initialized to NULL.
|
||||
The
|
||||
.BR initstate_r ()
|
||||
function records a pointer to the
|
||||
.I statebuf
|
||||
argument inside the structure pointed to by
|
||||
.IR buf .
|
||||
Thus,
|
||||
.IR statebuf
|
||||
should not be deallocated so long as
|
||||
.IR buf
|
||||
is still in use.
|
||||
(So,
|
||||
.I statebuf
|
||||
should typically be allocated as a static variable,
|
||||
or allocated on the heap using
|
||||
.BR malloc (3)
|
||||
or similar.)
|
||||
|
||||
The
|
||||
.BR setstate_r ()
|
||||
|
|
Loading…
Reference in New Issue