[APUE2nd学习笔记]Ch8. Process Control
trrrr 2006-04-13 11:13:22 process ID: non-negative integer
PID=0: scheduler process(swapper)
PID=1: init process
getpid, getppid, getuid, geteuid, getgid, getegid
fork:
1. parent and child share the text segment (copy-on-write)
2. all file descriptors are duplicated in child (as if the dup had been called, p214)
3. inherited properties and differences (p214-p215)
vfork:
1. parent and child run in the same address space
2. guarantees that child runs first
exit, _exit, _Exit
the init process becomes the parent process of any process whose parent terminates
zombie: terminated and its parent has not waited for it
the init process calls one of the wait functions for every child
wait, waitpid, wait3, wait4
parent and child relationship: p228
execl, execv, execle, execve, execlp, execvp:
1. PID does not change
2. property inheritance (p234)
3. close-on-exec (p234)
setuid, setgid, setreuid, setregid, seteuid, setegid: rules (p237-p238)
system: does all error handling and signal handling
getlogin
times: sysconf(_SC_CLK_TCK)