exit()

Creator
Created
Created
2019 Nov 5 5:17
Editor
Edited
Edited
2023 Oct 24 12:54

common process exit

exit → exit status
 

1. Process termination

Removes most references to the terminating process from kernel data structures: by calling __exit_mm(), __exit_files(), __exit_fs(), __exit_sighand().
Parentless children become children of the init process
Process 1
Invoke the
__schedule()
function to select a new process to run.
 

2. Process removal

  • UNIX kernels are not allowed to discard data right after the process terminates, but only after the parent process has issued a wait()-like system call that refers to the terminated process (TASK_ZOMBIE state).
  • Release 8KB memory area used to contain the thread_info struct and the
    Kernel Stack
    .
 
 
 
 
 

Recommendations