Commit | Line | Data |
---|---|---|
97be4b52 KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
cfb84303 | 5 | .\" @(#)getpid.2 6.1 (Berkeley) %G% |
97be4b52 | 6 | .\" |
cfb84303 | 7 | .TH GETPID 2 "" |
97be4b52 KM |
8 | .UC 4 |
9 | .SH NAME | |
209957d3 | 10 | getpid, getppid \- get process identification |
97be4b52 | 11 | .SH SYNOPSIS |
209957d3 KM |
12 | .ft B |
13 | .nf | |
14 | pid = getpid() | |
15 | long pid; | |
16 | .sp | |
17 | ppid = getppid() | |
18 | long ppid; | |
19 | .fi | |
20 | .ft R | |
97be4b52 KM |
21 | .SH DESCRIPTION |
22 | .I Getpid | |
23 | returns | |
24 | the process ID of | |
25 | the current process. | |
209957d3 KM |
26 | Most often it is used with the host identifier |
27 | .IR gethostid (2) | |
28 | to generate uniquely-named temporary files. | |
29 | .PP | |
30 | .I Getppid | |
31 | returns the process ID of the parent | |
32 | of the current process. | |
33 | .SH "SEE ALSO | |
34 | gethostid(2) |