1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH TCGETPGRP 3 2014-01-13 "GNU" "Linux Programmer's Manual"
27 tcgetpgrp, tcsetpgrp \- get and set terminal foreground process group
29 .B "#include <unistd.h>"
31 .BI "pid_t tcgetpgrp(int " fd );
33 .BI "int tcsetpgrp(int " fd ", pid_t " pgrp );
37 returns the process group ID of the foreground process group on the
38 terminal associated to
40 which must be the controlling terminal of the calling process.
41 .\" The process itself may be a background process.
45 makes the process group with process group ID
47 the foreground process group on the terminal associated to
49 which must be the controlling terminal of the calling process,
50 and still be associated with its session.
53 must be a (nonempty) process group belonging to
54 the same session as the calling process.
58 is called by a member of a background process group in its session,
59 and the calling process is not blocking or ignoring
63 signal is sent to all members of this background process group.
67 refers to the controlling terminal of the calling process,
70 will return the foreground process group ID of that terminal
71 if there is one, and some value larger than 1 that is not
72 presently a process group ID otherwise.
75 does not refer to the controlling terminal of the calling process,
83 Otherwise, it returns \-1, and
90 is not a valid file descriptor.
94 has an unsupported value.
97 The calling process does not have a controlling terminal, or
98 it has one but it is not described by
102 this controlling terminal is no longer associated with the session
103 of the calling process.
107 has a supported value, but is not the process group ID of a
108 process in the same session as the calling process.
110 .SS Multithreading (see pthreads(7))
115 functions are thread-safe.
119 These functions are implemented via the
125 The ioctls appeared in 4.2BSD.
126 The functions are POSIX inventions.