| 789 | } |
| 790 | |
| 791 | unsigned long |
| 792 | sys_random_seed(void) |
| 793 | { |
| 794 | unsigned long seed = 0L; |
| 795 | unsigned long pid = (unsigned long) getpid(); |
| 796 | boolean no_seed = TRUE; |
| 797 | |
| 798 | #ifdef AMIGA_STRONG_RANDOM_SEED_HERE |
| 799 | /* hypothetical - strong seed code is required */ |
| 800 | /* then has_strong_seed could be set */ |
| 801 | #endif |
| 802 | if (no_seed) { |
| 803 | seed = (unsigned long) getnow(); /* time((TIME_type) 0) */ |
| 804 | /* Quick dirty band-aid to prevent PRNG prediction */ |
| 805 | if (pid) { |
| 806 | if (!(pid & 3L)) |
| 807 | pid -= 1L; |
| 808 | seed *= pid; |
| 809 | } |
| 810 | } |
| 811 | return seed; |
| 812 | } |
| 813 | #endif |
| 814 | |
| 815 | /*pcmain.c*/ |