iansjack wrote:
The "exit" system call ought to handle this sort of thing.
That is probably the wrapper I'm talking about.
Anyway, a process is scheduled by OS kernel. It is the only one which knows the process' existence, other than the process itself. To be able to handle incoming signals (SIGTERM, SIGKILL) it needs to keep track of all running (and waiting) processes. I guess this is what embryo2 is referring to. But again, when a system call is raised, the operating system has no way to tell which process generated a system call right? It only knows how to respond, not whom to respond. So, if I'm correct exit() does not include sufficient information to notify the operating system about that specific process. So how does this all work?
Thank you for quick replies.
[edit] Okay, think I got it. To determine which process initiated the exit() system call, the operating system checks the queue for currently running process. This process should be the one that called the exit() because no other process is currently active. Sounds too generic though. [/edit]