[PATCH] Add example to rand.3

Alejandro Colomar alx.manpages@gmail.com
Wed Dec 28 21:18:52 GMT 2022



On 12/28/22 22:04, Cristian Rodríguez wrote:
> On Wed, Dec 28, 2022 at 5:57 PM Alejandro Colomar via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
> 
>> Ahh, I didn't connect the dots the other day!  We don't need to wait for glibc.
>> libbsd already provides arc4random on GNU/Linux systems, so I can already
>> recommend using arc4random to seed srand(3).
>>
>> I'll prepare a patch...
>>
> 
> I would suggest avoiding that, as it suffers from all the problems
> previously discussed on this list , on the relevant arc4random thread
> 
> tl;dr , it can't be safe without kernel support, as you need to know
> when to drop the buffer. (on fork, on resume plus on $deity knows
> condition for which there is no kernel notification about)

Maybe I'd remove the SEE ALSO reference to arc4random(3bsd) then, so that I 
don't "recommend" using it.  I'll add arc4random(3) to SEE ALSO when we have a 
manual page for the function.

-- 
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20221228/44a32cd2/attachment.sig>


More information about the Libc-alpha mailing list