mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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:
parent
f5744a6f2f
commit
7bdf54c837
Notes:
sideshowbarker
2024-07-19 04:06:44 +09:00
Author: https://github.com/BenWiederhake
Commit: 7bdf54c837
Pull-request: https://github.com/SerenityOS/serenity/pull/3057
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bgianfo
7 changed files with 53 additions and 46 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue