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
11

NAME

13       tcgetpgrp — get the foreground process group ID
14

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

50       None.
51

APPLICATION USAGE

53       None.
54

RATIONALE

56       None.
57

FUTURE DIRECTIONS

59       None.
60

SEE ALSO

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