Jonathan Drews said on Wed, 10 Apr 2024 22:28:41 -0600 >I get the following warning when I link the program RandomPasswdGen > >$ cc -Wall -c randpass.c >$ cc randpass.o -o RandomPasswdGen > randpass.c(randpass.o:(main)): warning: rand() may return > deterministic values, >is that what you want? > >How can I modify: >srand((int) time(NULL)); /* Set the seed */ > >to make it less deterministic ?
If you're on Linux, consider using getrandom() at least for the seed. Maybe it will work on BSD too: I don't have a BSD VM installed right now. man -a getrandom Also: man 7 random https://www.baeldung.com/linux/entropy-pool-rngd Maybe you can concatenate the epoch time concatenated with the uptime of a given daemon and the sum of the PID and STAT values in ps xo PID,STAT and the number of bytes in the command that's #1 in the top command at this instant and maybe a couple other things, and use that as a seed. Concatenate in lots of things that require root. For instance, lshw delivers very different results for root than for a normal user. HTH SteveT Steve Litt Autumn 2023 featured book: Rapid Learning for the 21st Century http://www.troubleshooters.com/rl21 _______________________________________________ Semibug mailing list Semibug@lists.nycbug.org https://lists.nycbug.org:8443/mailman/listinfo/semibug