int setpgid(pid_t pid, pid_t pgid); pid_t getpgid(pid_t pid);
pid_t getpgrp(void); /* POSIX.1 version */ pid_t getpgrp(pid_t
pid); /* BSD version */ int setpgrp(void); /* System V version
*/ int setpgrp(pid_t pid, pid_t pgid); /* BSD version */ Feature
Test Macro Requirements for glibc (see feature_test_macros(7)):
_SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE &&
_XOPEN_SOURCE_EXTENDED setpgrp() (BSD), getpgrp() (BSD):
_BSD_SOURCE && ! (_POSIX_SOURCE || _POSIX_C_SOURCE ||
_XOPEN_SOURCE || _XOPEN_SOURCE_EXTENDED || _GNU_SOURCE ||
_SVID_SOURCE) setpgid() sets the PGID of the process specified
by pid to pgid. If pid is zero, then the process ID of the
calling process is used. If pgid is zero, then the PGID of the
process specified by pid is made the same as its process ID. If
setpgid() is used to move a process from one process group to
another (as is done by some shells when creating pipelines),
both process groups must be part of the same session (see
setsid(2) and credentials(7)). In this case, the pg