1TCGETPGRP(P) POSIX Programmer's Manual TCGETPGRP(P)
2
3
4
6 tcgetpgrp - get the foreground process group ID
7
9 #include <unistd.h>
10
11 pid_t tcgetpgrp(int fildes);
12
13
15 The tcgetpgrp() function shall return the value of the process group ID
16 of the foreground process group associated with the terminal.
17
18 If there is no foreground process group, tcgetpgrp() shall return a
19 value greater than 1 that does not match the process group ID of any
20 existing process group.
21
22 The tcgetpgrp() function is allowed from a process that is a member of
23 a background process group; however, the information may be subse‐
24 quently changed by a process that is a member of a foreground process
25 group.
26
28 Upon successful completion, tcgetpgrp() shall return the value of the
29 process group ID of the foreground process associated with the termi‐
30 nal. Otherwise, -1 shall be returned and errno set to indicate the
31 error.
32
34 The tcgetpgrp() function shall fail if:
35
36 EBADF The fildes argument is not a valid file descriptor.
37
38 ENOTTY The calling process does not have a controlling terminal, or the
39 file is not the controlling terminal.
40
41
42 The following sections are informative.
43
45 None.
46
48 None.
49
51 None.
52
54 None.
55
57 setsid() , setpgid() , tcsetpgrp() , the Base Definitions volume of
58 IEEE Std 1003.1-2001, <sys/types.h>, <unistd.h>
59
61 Portions of this text are reprinted and reproduced in electronic form
62 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
63 -- Portable Operating System Interface (POSIX), The Open Group Base
64 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
65 Electrical and Electronics Engineers, Inc and The Open Group. In the
66 event of any discrepancy between this version and the original IEEE and
67 The Open Group Standard, the original IEEE and The Open Group Standard
68 is the referee document. The original Standard can be obtained online
69 at http://www.opengroup.org/unix/online.html .
70
71
72
73IEEE/The Open Group 2003 TCGETPGRP(P)