1TCSETPGRP(3P) POSIX Programmer's Manual TCSETPGRP(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 tcsetpgrp - set the foreground process group ID
13
15 #include <unistd.h>
16
17 int tcsetpgrp(int fildes, pid_t pgid_id);
18
19
21 If the process has a controlling terminal, tcsetpgrp() shall set the
22 foreground process group ID associated with the terminal to pgid_id.
23 The application shall ensure that the file associated with fildes is
24 the controlling terminal of the calling process and the controlling
25 terminal is currently associated with the session of the calling
26 process. The application shall ensure that the value of pgid_id matches
27 a process group ID of a process in the same session as the calling
28 process.
29
30 Attempts to use tcsetpgrp() from a process which is a member of a back‐
31 ground process group on a fildes associated with its controlling termi‐
32 nal shall cause the process group to be sent a SIGTTOU signal. If the
33 calling process is blocking or ignoring SIGTTOU signals, the process
34 shall be allowed to perform the operation, and no signal is sent.
35
37 Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
38 returned and errno set to indicate the error.
39
41 The tcsetpgrp() function shall fail if:
42
43 EBADF The fildes argument is not a valid file descriptor.
44
45 EINVAL This implementation does not support the value in the pgid_id
46 argument.
47
48 ENOTTY The calling process does not have a controlling terminal, or the
49 file is not the controlling terminal, or the controlling termi‐
50 nal is no longer associated with the session of the calling
51 process.
52
53 EPERM The value of pgid_id is a value supported by the implementation,
54 but does not match the process group ID of a process in the same
55 session as the calling process.
56
57
58 The following sections are informative.
59
61 None.
62
64 None.
65
67 None.
68
70 None.
71
73 tcgetpgrp(), the Base Definitions volume of IEEE Std 1003.1-2001,
74 <sys/types.h>, <unistd.h>
75
77 Portions of this text are reprinted and reproduced in electronic form
78 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
79 -- Portable Operating System Interface (POSIX), The Open Group Base
80 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
81 Electrical and Electronics Engineers, Inc and The Open Group. In the
82 event of any discrepancy between this version and the original IEEE and
83 The Open Group Standard, the original IEEE and The Open Group Standard
84 is the referee document. The original Standard can be obtained online
85 at http://www.opengroup.org/unix/online.html .
86
87
88
89IEEE/The Open Group 2003 TCSETPGRP(3P)