1
0
Fork 0
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:
Ben Wiederhake 2020-08-08 22:04:20 +02:00 committed by Andreas Kling
parent f5744a6f2f
commit 7bdf54c837
Notes: sideshowbarker 2024-07-19 04:06:44 +09:00
7 changed files with 53 additions and 46 deletions

View file

@ -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);
}