xref: /csrg-svn/lib/libc/sys/getpid.2 (revision 47208)
1*47208Scael.\" Copyright (c) 1980, 1991 Regents of the University of California.
2*47208Scael.\" All rights reserved.
320071Smckusick.\"
4*47208Scael.\" %sccs.include.redist.man%
520071Smckusick.\"
6*47208Scael.\"     @(#)getpid.2	6.4 (Berkeley) 03/10/91
7*47208Scael.\"
8*47208Scael.Dd
9*47208Scael.Dt GETPID 2
10*47208Scael.Os BSD 4
11*47208Scael.Sh NAME
12*47208Scael.Nm getpid ,
13*47208Scael.Nm getppid
14*47208Scael.Nd get parent or calling process identification
15*47208Scael.Sh SYNOPSIS
16*47208Scael.Fd #include <unistd.h>
17*47208Scael.Ft pid_t
18*47208Scael.Fn getpid void
19*47208Scael.Ft pid_t
20*47208Scael.Fn getppid void
21*47208Scael.Sh DESCRIPTION
22*47208Scael.Fn Getpid
2320071Smckusickreturns
2420071Smckusickthe process ID of
25*47208Scaelthe calling process.
26*47208ScaelThe ID is guaranteed to be unique and is
27*47208Scaeluseful for constructing temporary file names.
28*47208Scael.Pp
29*47208Scael.Fn Getppid
3020072Smckusickreturns the process ID of the parent
31*47208Scaelof the calling process.
32*47208Scael.Sh ERRORS
33*47208ScaelThe
34*47208Scael.Fn getpid
35*47208Scaeland
36*47208Scael.Fn getppid
37*47208Scaelfunctions are always successful, and no return value is reserved to
38*47208Scaelindicate an error.
39*47208Scael.Sh SEE ALSO
40*47208Scael.Xr gethostid 2
41*47208Scael.Sh STANDARDS
42*47208Scael.Fn Getpid
43*47208Scaeland
44*47208Scael.Fn getppid
45*47208Scaelconform to IEEE Std 1003.1-1988
46*47208Scael.Pq Dq Tn POSIX .
47