mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-26 09:35:46 +00:00
Kernel: PID/PGID typing
This compiles, and fixes two bugs: - setpgid() confusion (see previous commit) - tcsetpgrp() now allows to set a non-empty process group even if the group leader has already died. This makes Serenity slightly more POSIX-compatible.
This commit is contained in:
committed by
Andreas Kling
parent
f5744a6f2f
commit
7bdf54c837
@@ -100,7 +100,8 @@ ProcessID Process::allocate_pid()
|
||||
// Overflow is UB, and negative PIDs wreck havoc.
|
||||
// TODO: Handle PID overflow
|
||||
// For example: Use an Atomic<u32>, mask the most significant bit,
|
||||
// retry if PID is already taken as a PID, taken as a TID, or zero.
|
||||
// retry if PID is already taken as a PID, taken as a TID,
|
||||
// takes as a PGID, taken as a SID, or zero.
|
||||
return next_pid.fetch_add(1, AK::MemoryOrder::memory_order_acq_rel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user