random, srandom, and initstate
Mon May 31 09:01:00 GMT 2010
sorry for the late response.
On May 19 13:40, Joel Sherrill wrote:
> I have been looking around for an implementation
> to port to newlib. This is a link to the
> FreeBSD version.
> It is OK license-wise. But I was curious if
> (1) It's use of /dev/random and gettimeofday
> as possible seed sources can be accomodated
> in newlib. Probably need to be disabled
> via some conditional compilation.
I don't think you need to conditionalize them at all. gettimeofday is
expected to exist (but see below) and the existence of "/dev/random" is
tested by the open call anyway. If it doesn't exist, the srandomdev
function will use gettimeofday.
> (2) Should I go ahead and modify them to be
> the _r versions and have the non-_r version
> call those with static variables?
Yes. Along the same lines the srandomdev function should use the
Cygwin Project Co-Leader
More information about the Newlib