postgresql/src/backend/postmaster
Heikki Linnakangas 98c50656ca Increase the number of different values used when seeding random().
When a backend process is forked, we initialize the system's random number
generator with srandom(). The seed used is derived from the backend's pid
and the timestamp. However, we only used the microseconds part of the
timestamp, and it was XORed with the pid, so the total range of different
seed values chosen was 0-999999. That's quite limited.

Change the code to also use the seconds part of the timestamp in the seed,
and shift the microseconds so that all 32 bits of the seed are used.

Honza Horak
2013-10-24 17:00:18 +03:00
..
Makefile Allow background workers to be started dynamically. 2013-07-16 13:02:15 -04:00
autovacuum.c Rename various "freeze multixact" variables 2013-09-16 15:47:31 -03:00
bgworker.c Suppress a couple of compiler warnings seen with older gcc versions. 2013-10-22 21:31:57 -04:00
bgwriter.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
checkpointer.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
fork_process.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pgarch.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pgstat.c Be more wary of unwanted whitespace in pgstat_reset_remove_files(). 2013-08-19 19:36:04 -04:00
postmaster.c Increase the number of different values used when seeding random(). 2013-10-24 17:00:18 +03:00
startup.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
syslogger.c Emit a log message if output is about to be redirected away from stderr. 2013-08-13 15:24:52 -04:00
walwriter.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00