On Tue, Sep 20, 2005 at 02:34:37AM +0200, Hrvoje Niksic wrote:

> I have provided arguments for my position, to which you failed to
> respond.  You didn't give any reasons why you consider FreeBSD to be
> "very similar" to Linux

No response is needed. If you do not understand that the specific
implementation is irrelevant for the man page author, and that tne APIs
in FreeBSD and Linux are very similar then discussion with you
is not interesting.

> Better yet, the limited space available in a man page should be spent
> documenting the API Linux does support.  For example, it could mention
> that RAND_MAX is not 32767, unlike many other systems.  It could
> mention that RAND_MAX+1 causes an overflow on Linux, breaking poorly
> written code.  It could mention that rand(3) should *never* be used
> for cryptographic purposes.  It could mention that standard library
> functions do not influence the sequence of numbers returned by rand.
> It could document the period of the random number generator, or that
> ISO C requires the period to be at least 2**32, if the period is
> considered an implementation detail and not part of the API.

Some of these remarks could indeed be added to the manual page.
Submit a patch. Be careful to distinguish Linux-specific remarks
(dependency on Linux kernel) from libc-specific remarks
(dependency on libc or glibc or klibc or uClibc etc.) and
remarks about standard requirements, and general remarks
(like remarks about what is needed for crypto).
Be concise and precise.

Yes, the period is an implementation detail - the current
glibc implementation has a much larger period than the classical
Unix version. Classically rand() is bad and random() is much better
but for glibc the two are the same.

RAND_MAX is 2^31-1 in current glibc, and already had that value in libc4.

Andries



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to