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
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
48       The following sections are informative.
49

EXAMPLES

51       None.
52

APPLICATION USAGE

54       None.
55

RATIONALE

57       None.
58

FUTURE DIRECTIONS

60       None.
61

SEE ALSO

63       setsid(),  setpgid(),  tcsetpgrp(),  the  Base  Definitions  volume  of
64       IEEE Std 1003.1-2001, <sys/types.h>, <unistd.h>
65
67       Portions  of  this text are reprinted and reproduced in electronic form
68       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
69       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
70       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
71       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
72       event of any discrepancy between this version and the original IEEE and
73       The  Open Group Standard, the original IEEE and The Open Group Standard
74       is the referee document. The original Standard can be  obtained  online
75       at http://www.opengroup.org/unix/online.html .
76
77
78
79IEEE/The Open Group                  2003                        TCGETPGRP(3P)
Impressum