[PATCH] Add simple versions of random() and srandom()

Yaakov Selkowitz yselkowitz@cygwin.com
Wed Mar 23 18:01:00 GMT 2016


On 2016-03-23 09:32, Craig Howland wrote:
> On 03/23/2016 01:04 AM, Yaakov Selkowitz wrote:
>> On 2016-03-22 17:51, Joel Sherrill wrote:
>>> Prototypes also added for initstate() and setstate() but they
>>> were not implemented.
>>
>> This should allow Cygwin to remove its own declarations of these
>> functions.
>>
>>> +#if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE
>>
>> #if __MISC_VISIBLE || __XSI_VISIBLE >= 500
> No, the value 4 is actually the right one.  At first look I had also
> thought that it needed to be 500, but it originated in issue 4 as an
> X/OPEN UNIX extension (see
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/random.html),
> and was moved to BASE in issue 5.

Just great, so we have conflicting documentation. :-(  I agree with your 
assessment but Linux man-pages says it's >= 500:

http://man7.org/linux/man-pages/man3/random.3.html

-- 
Yaakov



More information about the Newlib mailing list