*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/getpid (2)              
Title
Content
Arch
Section
 

Contents


getpid(2)							     getpid(2)


NAME    [Toc]    [Back]

     getpid, getpgrp, getppid, getpgid,	BSDgetpgrp - get process, process
     group, and	parent process IDs

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <unistd.h>

     pid_t getpid(void);

     pid_t getpgrp(void);

     pid_t getppid(void);

     pid_t getpgid(pid_t pid);

     pid_t BSDgetpgrp(pid_t pid);

DESCRIPTION    [Toc]    [Back]

     getpid returns the	process	ID of the calling process.

     getpgrp returns the process group ID of the calling process.  The
     BSDgetpgrp	form is	provided for Berkeley compatibility.  If the pid_t is
     0,	it is the same as the getpgrp form, otherwise it returns the process
     group for the argument, if	the process exists.

     getppid returns the parent	process	ID of the calling process.

     getpgid returns the process group ID of the process whose process ID is
     equal to pid, or the process group	ID of the calling process, if pid is
     equal to zero.

     getpgid will fail if one or more of the following is true:

     EPERM	    If the process whose process ID is equal to	pid is not in
		    the	same session as	the calling process, the
		    implementation does	not allow access to the	process	group
		    ID of that process from the	calling	process.  Under	IRIX,
		    access to the group	ID of that process is always allowed
		    to the calling process.

     EACCES	    In the Trusted IRIX	environment, the MAC label of the
		    current process does not dominate and is not equal to the
		    MAC	label of the process pid , and the current process
		    does not have the CAP_MAC_READ capability.

     EINVAL	    The	pid is out of range or is an invalid argument.

     ESRCH	    There is no	process	with a process ID equal	to pid.






									Page 1






getpid(2)							     getpid(2)


SEE ALSO    [Toc]    [Back]

      
      
     exec(2), fork(2), getpid(2), getsid(2), intro(2), setpgid(2), setsid(2)
     setpgrp(2), signal(2), capabilities(4), dominance(5).

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, getpgid returns a process group ID.
     Otherwise,	a value	of (pid_t) -1 is returned and errno is set to indicate
     the error.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
getpid Tru64 Get the process ID, process group ID, or parent process ID
getpid HP-UX get process, process group and parent process ID.
getpgrp HP-UX get process, process group and parent process ID.
getppid HP-UX get process, process group and parent process ID.
getpgrp Tru64 Get the process ID, process group ID, or parent process ID
getppid Tru64 Get the process ID, process group ID, or parent process ID
getpgrp2 HP-UX get process, process group and parent process ID.
getpgid HP-UX get process, process group and parent process ID.
nsg_attach_pid Tru64 Attaches a process to, or detaches a process from a NUMA Scheduling Group (libnuma library)
nsg_detach_pid Tru64 Attaches a process to, or detaches a process from a NUMA Scheduling Group (libnuma library)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service