Blob
1 .TH GETPID 32 .SH NAME3 getpid, getppid \- get process ids4 .SH SYNOPSIS5 .B #include <u.h>6 .br7 .B #include <libc.h>8 .PP9 .B10 int getpid(void)11 .PP12 .B13 int getppid(void)14 .SH DESCRIPTION15 .I Getpid16 reads17 .B /dev/pid18 (see19 .IR cons (3))20 and converts it to get the process id of the current process,21 a number guaranteed to be unique among all running processes on the machine22 executing23 .IR getpid .24 .PP25 .I Getppid26 reads27 .B /dev/ppid28 (see29 .IR cons (3))30 and converts it to get the id of the parent of the current process.31 .SH SOURCE32 .B /usr/local/plan9/src/libc/9sys33 .SH SEE ALSO34 .IR intro (3),35 .IR cons (3),36 .IR proc (3)37 .SH DIAGNOSTICS38 Returns 0 and39 sets40 .I errstr41 if unsuccessful.