On Sun, Dec 16, 2001 at 10:56:20PM +0100, Hrvoje Niksic wrote:
>Alan Eldridge <[EMAIL PROTECTED]> writes:
>
>> [...]
>> DESCRIPTION
>>      These interfaces are obsoleted by random(3).
>> 
>> I wrote the random-wait patch, and it used random(3) if that was
>> available on the system.
>
>Yes, but if I remember correctly, your patch disabled the feature
>completely if random was missing.  rand() is always available, so I
>switched to that.
>
>> We should not be using deprecated interfaces unless random() is not
>> available.
>
>rand() may have its problems with reentrance and use in multithreaded
>applications, but those are not relevant for Wget.  rand() has made it
>to ISO C, it's universally available, and it's certainly not going
>anywhere.

If rand() is truly universally available, I have no problem. 

When my man page on FBSD tells me that the interface is obsolete, 
that raises a flag in my mind. 

I just checked SUSv2 and rand() and random() are both there. It would appear
that random() obsoletes rand() because random() generates a better sequence.
This is not something we are really concerned about here. "Good enough" is
good enough.

So, go with rand(), or, if multithreadedness (multiple simultaneous d/ls)
ever may become a concern, rand_r(unsigned*).

If rand() ever disappears on a platform, I'm sure you'll hear about it. :)

-- 
Alan Eldridge
Just another $THING hacker.

Reply via email to