random_r.3: Add BUGS section pointing out the weirdness of the initstate_r() API

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-01-25 09:54:36 +13:00
parent 516a39595e
commit 606b226bd2
1 changed files with 11 additions and 0 deletions

View File

@ -175,6 +175,17 @@ T} Thread safety MT-Safe race:buf
These functions are nonstandard glibc extensions.
.\" These functions appear to be on Tru64, but don't seem to be on
.\" Solaris, HP-UX, or FreeBSD.
.SH BUGS
The
.BR initstate_r ()
interface is confusing.
.\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=3662
It appears that the
.IR random_data
type is intended to be opaque,
but the implementation requires the user to either initialize the
.I buf.state
file to NULL or zero out the entire structure before the call.
.SH SEE ALSO
.BR drand48 (3),
.BR rand (3),