xref: /original-bsd/lib/libc/sys/getpid.2 (revision c3e32dec)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getpid.2	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt GETPID 2
10.Os BSD 4
11.Sh NAME
12.Nm getpid ,
13.Nm getppid
14.Nd get parent or calling process identification
15.Sh SYNOPSIS
16.Fd #include <unistd.h>
17.Ft pid_t
18.Fn getpid void
19.Ft pid_t
20.Fn getppid void
21.Sh DESCRIPTION
22.Fn Getpid
23returns
24the process ID of
25the calling process.
26The ID is guaranteed to be unique and is
27useful for constructing temporary file names.
28.Pp
29.Fn Getppid
30returns the process ID of the parent
31of the calling process.
32.Sh ERRORS
33The
34.Fn getpid
35and
36.Fn getppid
37functions are always successful, and no return value is reserved to
38indicate an error.
39.Sh SEE ALSO
40.Xr gethostid 2
41.Sh STANDARDS
42.Fn Getpid
43and
44.Fn getppid
45conform to IEEE Std 1003.1-1988
46.Pq Dq Tn POSIX .
47