Professional Documents
Culture Documents
l ogi n kt hr e add s s hd
pi d = 8415 pi d = 2 pi d = 3028
e mac s t cs ch
ps
pi d = 9204 pi d = 4005
pi d = 9298
$ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
runner 1 0.0 0.0 1385548 13068 ? SLsl 19:47 0:00 /inject/init
runner 12 0.0 0.0 20192 3848 pts/0 Ss 19:58 0:00 bash --norc
runner 18 0.0 0.0 36092 3384 pts/0 R+ 19:58 0:00 ps -aux
Process Creation (Cont.)
• Address space
– Child is a duplicate of parent
– Child has a program loaded into it (using
exec system calls)
• UNIX examples
– fork() system call creates new process
– exec() system call used after a fork()
to replace the process’ memory space with
a new program
C Program Forking Separate Process
Process Termination