2 ms·
The rand(3) thing isn't about repeatability across implementations. Normally if you call srand(3) with the same seed, you get the same sequence of numbers from
by spauldo 1y ago
The rand(3) thing isn't about repeatability across implementations. Normally if you call srand(3) with the same seed, you get the same sequence of numbers from rand(3). It's useful for testing and debugging. OpenBSD ignores srand(3) altogether. The reasoning is that there are enough cases of people improperly seeding the PRNG that it's worth breaking POSIX to mitigate possible vulnerabilities.
I personally don't have an issue with their choices - they're completely in line with OpenBSD's mission of producing a secure OS. I'd be less pleased to see that sort of thing in other systems like NetBSD, though.