Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_fork.c
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | fork_findpid(int flags) | ||||
/* | /* | ||||
* Find an unused process ID. We remember a range of unused IDs | * Find an unused process ID. We remember a range of unused IDs | ||||
* ready to use (from lastpid+1 through pidchecked-1). | * ready to use (from lastpid+1 through pidchecked-1). | ||||
* | * | ||||
* If RFHIGHPID is set (used during system boot), do not allocate | * If RFHIGHPID is set (used during system boot), do not allocate | ||||
* low-numbered pids. | * low-numbered pids. | ||||
*/ | */ | ||||
trypid = lastpid + 1; | trypid = lastpid + 1; | ||||
if (flags & RFHIGHPID) { | if (flags & RFPID1) { | ||||
trypid = 1; | |||||
} else if (flags & RFHIGHPID) { | |||||
if (trypid < 10) | if (trypid < 10) | ||||
trypid = 10; | trypid = 10; | ||||
} else { | } else { | ||||
if (randompid) | if (randompid) | ||||
trypid += arc4random() % randompid; | trypid += arc4random() % randompid; | ||||
} | } | ||||
retry: | retry: | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 818 Lines • Show Last 20 Lines |