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

  man pages->OpenBSD man pages -> getpgid (2)              
Title
Content
Arch
Section
 

GETPGRP(2)

Contents


NAME    [Toc]    [Back]

     getpgrp - get process group

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     pid_t
     getpgrp(void);

     pid_t
     getpgid(pid_t pid);

DESCRIPTION    [Toc]    [Back]

     The process group of the  current  process  is  returned  by
getpgrp().  The
     process group of the pid process is returned by getpgid().

     Process  groups are used for distribution of signals, and by
terminals to
     arbitrate requests for their input: processes that have  the
same process
     group  as  the  terminal  are foreground and may read, while
others will
     block with a signal if they attempt to read.

     This call is thus used by programs such as csh(1) to  create
process
     groups  in  implementing  job  control.  The tcgetpgrp() and
tcsetpgrp()
     calls are used to get/set the process group of  the  control
terminal.

ERRORS    [Toc]    [Back]

     getpgrp()  always  succeeds,  however getpgid() will succeed
unless:

     [EPERM]       The current process and the  process  pid  are
not in the same
                   session.

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

SEE ALSO    [Toc]    [Back]

      
      
     setpgid(2), termios(4)

STANDARDS    [Toc]    [Back]

     This version of getpgrp() differs from  past  Berkeley  versions by not taking
  a pid_t pid argument.  This incompatibility is required
by IEEE Std
     1003.1-1988 (``POSIX'').

     From the IEEE Std 1003.1-1988 (``POSIX'') Rationale:

     4.3BSD provides a getpgrp() function that returns  the  process group ID
     for  a specified process.  Although this function is used to
support job
     control, all known job-control  shells  always  specify  the
calling process
     with  this  function.   Thus, the simpler System V getpgrp()
suffices, and
     the added complexity of the 4.3BSD getpgrp() has been  omitted from
     POSIX.1.

     The  getpgrp()  function  conforms  to  IEEE Std 1003.1-1988
(``POSIX'').  The
     getpgid() function call is derived from its usage in  System
V Release 4,
     and first appeared in NetBSD 1.2A.

HISTORY    [Toc]    [Back]

     The getpgrp() function call appeared in 4.0BSD.

OpenBSD      3.6                           June      4,      1993
[ Back ]
 Similar pages
Name OS Title
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)
pgsignal FreeBSD post signal to a process or process group
gsignal FreeBSD post signal to a process or process group
psignal FreeBSD post signal to a process or process group
pfind OpenBSD find process / process group by number
pgfind OpenBSD find process / process group by number
getpgrp HP-UX get process, process group and parent process ID.
getpid HP-UX get process, process group and parent process ID.
getpgrp2 HP-UX get process, process group and parent process ID.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service