On Fri, May 19, 2006 at 11:03:58AM +0100, Andy Green wrote: > >You need to make sure *randomdataState is zero initialized before calling > >initstate_r for the first time. So, e.g. add > >memset (randomdataState, 0, sizeof (*randomdataState)); > >here. > > How can one discover this knowledge? There seems to be no manpage and > Google did not describe this as well as it usually does. Comments in the source? http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/stdlib/random.c?cvsroot=glibc http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/stdlib/random_r.c?cvsroot=glibc There is some (limited) info in info random_r too, feel free to submit documentation patches to make stuff more clear. Jakub