Process Creation & Termination

flowchart LR
    fork["fork()"]
    wait["wait"]
    resumes["resumes"]
    exec["exec()"]
    exit["exit()"]
    
    fork -->|parent| wait
    wait --> resumes
    fork -->|child| exec
    exec --> exit
    exit -.-> wait
    
    style exit stroke:#ff9999,stroke-width:3px

很重要的一張圖

fork

Termination

Normal Termination

Abnormal Termination

  • call abort() (這就是跟 kernel 説:「我要自殺了」,然後 kernel 説:「我準了」)
  • terminated by signal

wait

exec