rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 1 | .TH GETPID 3 |
| 2 | .SH NAME |
| 3 | getpid, getppid \- get process ids |
| 4 | .SH SYNOPSIS |
| 5 | .B #include <u.h> |
| 6 | .br |
| 7 | .B #include <libc.h> |
| 8 | .PP |
| 9 | .B |
| 10 | int getpid(void) |
| 11 | .PP |
| 12 | .B |
| 13 | int getppid(void) |
| 14 | .SH DESCRIPTION |
| 15 | .I Getpid |
| 16 | reads |
| 17 | .B /dev/pid |
| 18 | (see |
| 19 | .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 machine |
| 22 | executing |
| 23 | .IR getpid . |
| 24 | .PP |
| 25 | .I Getppid |
| 26 | reads |
| 27 | .B /dev/ppid |
| 28 | (see |
| 29 | .IR cons (3)) |
| 30 | and converts it to get the id of the parent of the current process. |
| 31 | .SH SOURCE |
rsc | b5fdffe | 2004-04-19 19:22:56 +0000 | [diff] [blame] | 32 | .B /usr/local/plan9/src/libc/9sys |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 33 | .SH SEE ALSO |
rsc | bf8a59f | 2004-04-11 03:42:27 +0000 | [diff] [blame] | 34 | .IR intro (3), |
rsc | cfa37a7 | 2004-04-10 18:53:55 +0000 | [diff] [blame] | 35 | .IR cons (3), |
| 36 | .IR proc (3) |
| 37 | .SH DIAGNOSTICS |
| 38 | Returns 0 and |
| 39 | sets |
| 40 | .I errstr |
| 41 | if unsuccessful. |