mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
Kernel: Distinguish between new and old process groups with equal pgids
This does not add any behaviour change to the processes, but it ties a TTY to an active process group via TIOCSPGRP, and returns the TTY to the kernel when all processes in the process group die. Also makes the TTY keep a link to the original controlling process' parent (for SIGCHLD) instead of the process itself.
This commit is contained in:
parent
cf18bff72a
commit
688e54eac7
9 changed files with 176 additions and 23 deletions
|
@ -40,6 +40,7 @@
|
|||
#include <Kernel/FileSystem/InodeMetadata.h>
|
||||
#include <Kernel/Forward.h>
|
||||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/ProcessGroup.h>
|
||||
#include <Kernel/StdLib.h>
|
||||
#include <Kernel/Thread.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
@ -159,8 +160,8 @@ public:
|
|||
ProcessID pid() const { return m_pid; }
|
||||
SessionID sid() const { return m_sid; }
|
||||
bool is_session_leader() const { return m_sid.value() == m_pid.value(); }
|
||||
ProcessGroupID pgid() const { return m_pgid; }
|
||||
bool is_group_leader() const { return m_pgid.value() == m_pid.value(); }
|
||||
ProcessGroupID pgid() const { return m_pg ? m_pg->pgid() : 0; }
|
||||
bool is_group_leader() const { return pgid().value() == m_pid.value(); }
|
||||
const FixedArray<gid_t>& extra_gids() const { return m_extra_gids; }
|
||||
uid_t euid() const { return m_euid; }
|
||||
gid_t egid() const { return m_egid; }
|
||||
|
@ -620,7 +621,7 @@ private:
|
|||
|
||||
ProcessID m_pid { 0 };
|
||||
SessionID m_sid { 0 };
|
||||
ProcessGroupID m_pgid { 0 };
|
||||
RefPtr<ProcessGroup> m_pg;
|
||||
|
||||
uid_t m_euid { 0 };
|
||||
gid_t m_egid { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue