r/C_Programming • • Sep 01 '26

Question How process ids are generated

i know fork creates processes but how process ids are generated

6 Upvotes

22 comments sorted by

View all comments

3

u/realdreamer1993 Sep 07 '26

the kernel have the main object(table/struct) that contain all data to track state of processes, then the ids is just the index. BTW kernel also just a program.

1

u/userlivedhere Sep 07 '26

Understandable answer thanks