Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

fork(2)

getpid(2)

getsid(2)

intro(2)

setpgid(2)

setpgrp(2)

signal(2)

getpid(2)

NAME

getpid, getpgrp, getppid, getpgid − get process, process group, and parent process IDs

SYNOPSIS

#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);

DESCRIPTION

getpid() returns the process ID of the calling process. 

getpgrp() returns the process group ID of the calling process. 

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. 

RETURN VALUES

Upon successful completion, all return the process group ID.  On failure, getpgid() returns a value of (pid_t) −1 and sets errno to indicate the error. 

ERRORS

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

EPERM The process whose process ID is equal to pid is not in the same session as the calling process, and the implementation does not allow access to the process group ID of that process from the calling process. 

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

SEE ALSO

exec(2), fork(2), getpid(2), getsid(2), intro(2), setpgid(2), setpgrp(2), signal(2)
 

SunOS 5.1/x86  —  Last change: 29 Jul 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026