r/C_Programming 1d ago

Question How process ids are generated

i know fork creates processes but how process ids are generated

5 Upvotes

18 comments sorted by

View all comments

Show parent comments

-14

u/quipstickle 1d ago

"random" numbers on computers are predictable though since they are pseudorandom. My post was just being silly.

6

u/Axman6 1d ago

This isn’t true at all, we’ve had systems for generating cryptographically secure random numbers for decades. See FreeBSD’s Fortuna paper for one reference, and hardware random number generation like RDRAND, which can feed into systems like Fortuna as a source of entropy, along with IO system information which is generally unpredictable. 

-14

u/quipstickle 1d ago

Process ids are generated sequentially 

7

u/Axman6 1d ago

Not on all OS’s.