]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/setpgid.2
fanotify.7: tfix
[thirdparty/man-pages.git] / man2 / setpgid.2
index 8cf2be11f13f1f7b153c372ce0103a35586a3f2d..be451e7653097041f3beceaa097cd9adc7ac71ce 100644 (file)
 .\" 2007-07-25, mtk, fairly substantial rewrites and rearrangements
 .\" of text.
 .\"
-.TH SETPGID 2 2016-03-15 "Linux" "Linux Programmer's Manual"
+.TH SETPGID 2 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 setpgid, getpgid, setpgrp, getpgrp \- set/get process group
 .SH SYNOPSIS
+.B #include <sys/types.h>
+.br
 .B #include <unistd.h>
-.sp
+.PP
 .BI "int setpgid(pid_t " pid ", pid_t " pgid );
 .br
 .BI "pid_t getpgid(pid_t " pid );
-.sp
+.PP
 .BR "pid_t getpgrp(void);" "                 /* POSIX.1 version */"
 .br
 .BI "pid_t getpgrp(pid_t " pid ");\ \ \ \ \ \ \ \ \ \ \ "
 /* BSD version */
-.sp
+.PP
 .BR "int setpgrp(void);" "                   /* System V version */"
 .br
 .BI "int setpgrp(pid_t " pid ", pid_t " pgid ");\ "
 /* BSD version */
-.sp
+.PP
 .in -4n
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
 .in
-.sp
+.PP
 .ad l
-.PD 0
 .BR getpgid ():
 .RS 4
 _XOPEN_SOURCE\ >=\ 500
@@ -79,7 +80,7 @@ _XOPEN_SOURCE\ >=\ 500
 .br
     || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
 .RE
-.sp
+.PP
 .BR setpgrp "() (POSIX.1):"
 .nf
     _XOPEN_SOURCE\ >=\ 500
@@ -87,7 +88,7 @@ _XOPEN_SOURCE\ >=\ 500
         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
         || /* Glibc versions <= 2.19: */ _SVID_SOURCE
 .fi
-.sp
+.PP
 .BR setpgrp "()\ (BSD),"
 .BR getpgrp "()\ (BSD):"
 .nf
@@ -96,7 +97,6 @@ _XOPEN_SOURCE\ >=\ 500
         !\ (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE ||
             _GNU_SOURCE || _SVID_SOURCE)
 .fi
-.PD
 .ad
 .SH DESCRIPTION
 All of these interfaces are available on Linux,
@@ -107,7 +107,7 @@ The preferred, POSIX.1-specified ways of doing this are:
 for retrieving the calling process's PGID; and
 .BR setpgid (),
 for setting a process's PGID.
-
+.PP
 .BR setpgid ()
 sets the PGID of the process specified by
 .I pid
@@ -132,12 +132,12 @@ and
 In this case,
 the \fIpgid\fP specifies an existing process group to be joined and the
 session ID of that group must match the session ID of the joining process.
-
+.PP
 The POSIX.1 version of
 .BR getpgrp (),
 which takes no arguments,
 returns the PGID of the calling process.
-
+.PP
 .BR getpgid ()
 returns the PGID of the process specified by
 .IR pid .
@@ -148,12 +148,12 @@ is zero, the process ID of the calling process is used.
 necessary, and the POSIX.1
 .BR getpgrp ()
 is preferred for that task.)
-
+.PP
 The System\ V-style
 .BR setpgrp (),
 which takes no arguments, is equivalent to
 .IR "setpgid(0,\ 0)" .
-
+.PP
 The BSD-specific
 .BR setpgrp ()
 call, which takes arguments
@@ -161,9 +161,9 @@ call, which takes arguments
 and
 .IR pgid ,
 is a wrapper function that calls
-
+.PP
     setpgid(pid, pgid)
-
+.PP
 .\" The true BSD setpgrp() system call differs in allowing the PGID
 .\" to be set to arbitrary values, rather than being restricted to
 .\" PGIDs in the same session.
@@ -174,15 +174,15 @@ function is no longer exposed by
 calls should be replaced with the
 .BR setpgid ()
 call shown above.
-
+.PP
 The BSD-specific
 .BR getpgrp ()
 call, which takes a single
 .I pid
 argument, is a wrapper function that calls
-
+.PP
     getpgid(pid)
-
+.PP
 Since glibc 2.19, the BSD-specific
 .BR getpgrp ()
 function is no longer exposed by
@@ -202,11 +202,11 @@ return zero.
 On error, \-1 is returned, and
 .I errno
 is set appropriately.
-
+.PP
 The POSIX.1
 .BR getpgrp ()
 always returns the PGID of the caller.
-
+.PP
 .BR getpgid (),
 and the BSD-specific
 .BR getpgrp ()
@@ -254,7 +254,7 @@ and the version of
 .BR getpgrp ()
 with no arguments
 conform to POSIX.1-2001.
-
+.PP
 POSIX.1-2001 also specifies
 .BR getpgid ()
 and the version of
@@ -263,7 +263,7 @@ that takes no arguments.
 (POSIX.1-2008 marks this
 .BR setpgrp ()
 specification as obsolete.)
-
+.PP
 The version of
 .BR getpgrp ()
 with one argument and the version of
@@ -276,12 +276,12 @@ A child created via
 inherits its parent's process group ID.
 The PGID is preserved across an
 .BR execve (2).
-
+.PP
 Each process group is a member of a session and each process is a
 member of the session of which its process group is a member.
 (See
 .BR credentials (7).)
-
+.PP
 A session can have a controlling terminal.
 At any time, one (and only one) of the process groups
 in the session can be the foreground process group
@@ -308,7 +308,7 @@ and
 .BR tcsetpgrp (3)
 functions are used to get/set the foreground
 process group of the controlling terminal.
-
+.PP
 The
 .BR setpgid ()
 and
@@ -316,7 +316,7 @@ and
 calls are used by programs such as
 .BR bash (1)
 to create process groups in order to implement shell job control.
-
+.PP
 If the termination of a process causes a process group to become orphaned,
 and if any member of the newly orphaned process group is stopped, then a
 .B SIGHUP