Download PLAN 9 from BELL LABS PROGRAMMER`S

Transcript
GETPID ( 2 )
GETPID ( 2 )
N
NA
AM
ME
E
getpid, getppid – get process ids
S
SY
YN
NO
OP
PS
SIIS
S
int getpid(void)
int getppid(void)
D
DE
ES
SC
CR
RIIP
PT
TIIO
ON
N
Getpid reads /dev/pid (see cons(3)) and converts it to get the process id of the current process, a number
guaranteed to be unique among all running processes on the machine executing getpid.
Getppid reads /dev/ppid (see cons(3)) and converts it to get the id of the parent of the current process.
S
SE
EE
E A
AL
LS
SO
O
intro(2), cons(3), proc(3)
D
DIIA
AG
GN
NO
OS
ST
TIIC
CS
S
Returns 0 and sets errstr if unsuccessful.
Page 235
Plan 9
January 20, 1993