- next = gethostid();
- if (gettimeofday(&tv, NULL)) {
- perror("gettimeofday");
- exit(1);
- }
- next ^= (uint32) tv.tv_sec ^ (uint32) tv.tv_usec;
-
- srandom((int) next);
+ gettimeofday(&t, NULL);
+ seed = gethostid() ^ t.tv_sec ^ t.tv_usec ^ getpid();
+ srand48(seed);