1TCGETPGRP(3P)              POSIX Programmer's Manual             TCGETPGRP(3P)
2
3
4

PROLOG

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

NAME

12       tcgetpgrp — get the foreground process group ID
13

SYNOPSIS

15       #include <unistd.h>
16
17       pid_t tcgetpgrp(int fildes);
18

DESCRIPTION

20       The tcgetpgrp() function shall return the value of the process group ID
21       of the foreground process group associated with the terminal.
22
23       If  there  is  no  foreground process group, tcgetpgrp() shall return a
24       value greater than 1 that does not match the process group  ID  of  any
25       existing process group.
26
27       The  tcgetpgrp() function is allowed from a process that is a member of
28       a background process group; however,  the  information  may  be  subse‐
29       quently  changed  by a process that is a member of a foreground process
30       group.
31

RETURN VALUE

33       Upon successful completion, tcgetpgrp() shall return the value  of  the
34       process  group  ID of the foreground process associated with the termi‐
35       nal. Otherwise, -1 shall be returned and  errno  set  to  indicate  the
36       error.
37

ERRORS

39       The tcgetpgrp() function shall fail if:
40
41       EBADF  The fildes argument is not a valid file descriptor.
42
43       ENOTTY The calling process does not have a controlling terminal, or the
44              file is not the controlling terminal.
45
46       The following sections are informative.
47

EXAMPLES

49       None.
50

APPLICATION USAGE

52       None.
53

RATIONALE

55       None.
56

FUTURE DIRECTIONS

58       None.
59

SEE ALSO

61       setsid(), setpgid(), tcsetpgrp()
62
63       The Base Definitions volume of POSIX.1‐2017, <sys_types.h>, <unistd.h>
64
66       Portions of this text are reprinted and reproduced in  electronic  form
67       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
68       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
69       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
70       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
71       event of any discrepancy between this version and the original IEEE and
72       The Open Group Standard, the original IEEE and The Open Group  Standard
73       is  the  referee document. The original Standard can be obtained online
74       at http://www.opengroup.org/unix/online.html .
75
76       Any typographical or formatting errors that appear  in  this  page  are
77       most likely to have been introduced during the conversion of the source
78       files to man page format. To report such errors,  see  https://www.ker
79       nel.org/doc/man-pages/reporting_bugs.html .
80
81
82
83IEEE/The Open Group                  2017                        TCGETPGRP(3P)
Impressum