CVSROOT:        /cvs
Module name:    ports
Changes by:     [email protected]    2024/11/04 04:04:46

Modified files:
        lang/mawk      : Makefile 
Added files:
        lang/mawk/patches: patch-configure 

Log message:
Fix up srand(value) and make its outcome deterministic

Upstream decided to avoid using arc4random() for random numbers, noting
that is wasn't possible to get a deterministic output by using awk's
srand(value). But on our system, all of the C srandom / srand etc
functions will ignore their argument. You need to call
srandom_deterministic / srand_deterministic instead.  So:
- use srandom_deterministic() to implement mawk's srand(value) and get
reproducible output where useful.
- stop mawk from initializing the PRNG at startup, so that it
can benefit from our default initialization which is stronger than
mawk's seeding with Unix epoch.

This brings mawk in line with base awk(1) and still respects POSIX.

Reply via email to