blob: 44837f69ecfd473a9cbbb74c942efdb29df1fc86 [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH GETPID 3
2.SH NAME
3getpid, getppid \- get process ids
4.SH SYNOPSIS
5.B #include <u.h>
6.br
7.B #include <libc.h>
8.PP
9.B
10int getpid(void)
11.PP
12.B
13int getppid(void)
14.SH DESCRIPTION
15.I Getpid
16reads
17.B /dev/pid
18(see
19.IR cons (3))
20and converts it to get the process id of the current process,
21a number guaranteed to be unique among all running processes on the machine
22executing
23.IR getpid .
24.PP
25.I Getppid
26reads
27.B /dev/ppid
28(see
29.IR cons (3))
30and converts it to get the id of the parent of the current process.
31.SH SOURCE
rscb5fdffe2004-04-19 19:22:56 +000032.B /usr/local/plan9/src/libc/9sys
rsccfa37a72004-04-10 18:53:55 +000033.SH SEE ALSO
rscbf8a59f2004-04-11 03:42:27 +000034.IR intro (3),
rsccfa37a72004-04-10 18:53:55 +000035.IR cons (3),
36.IR proc (3)
37.SH DIAGNOSTICS
38Returns 0 and
39sets
40.I errstr
41if unsuccessful.