xref: /csrg-svn/lib/libc/sys/getpid.2 (revision 61181)
1*61181Sbostic.\" Copyright (c) 1980, 1991, 1993
2*61181Sbostic.\"	The Regents of the University of California.  All rights reserved.
320071Smckusick.\"
447208Scael.\" %sccs.include.redist.man%
520071Smckusick.\"
6*61181Sbostic.\"     @(#)getpid.2	8.1 (Berkeley) 06/04/93
747208Scael.\"
847208Scael.Dd
947208Scael.Dt GETPID 2
1047208Scael.Os BSD 4
1147208Scael.Sh NAME
1247208Scael.Nm getpid ,
1347208Scael.Nm getppid
1447208Scael.Nd get parent or calling process identification
1547208Scael.Sh SYNOPSIS
1647208Scael.Fd #include <unistd.h>
1747208Scael.Ft pid_t
1847208Scael.Fn getpid void
1947208Scael.Ft pid_t
2047208Scael.Fn getppid void
2147208Scael.Sh DESCRIPTION
2247208Scael.Fn Getpid
2320071Smckusickreturns
2420071Smckusickthe process ID of
2547208Scaelthe calling process.
2647208ScaelThe ID is guaranteed to be unique and is
2747208Scaeluseful for constructing temporary file names.
2847208Scael.Pp
2947208Scael.Fn Getppid
3020072Smckusickreturns the process ID of the parent
3147208Scaelof the calling process.
3247208Scael.Sh ERRORS
3347208ScaelThe
3447208Scael.Fn getpid
3547208Scaeland
3647208Scael.Fn getppid
3747208Scaelfunctions are always successful, and no return value is reserved to
3847208Scaelindicate an error.
3947208Scael.Sh SEE ALSO
4047208Scael.Xr gethostid 2
4147208Scael.Sh STANDARDS
4247208Scael.Fn Getpid
4347208Scaeland
4447208Scael.Fn getppid
4547208Scaelconform to IEEE Std 1003.1-1988
4647208Scael.Pq Dq Tn POSIX .
47