Commit | Line | Data |
---|---|---|
5a58c649 MT |
1 | .\" Copyright (c) 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" %sccs.include.redist.roff% | |
5 | .\" | |
6175c3fa | 6 | .\" @(#)tcgetpgrp.3 5.3 (Berkeley) %G% |
5a58c649 | 7 | .\" |
d365c391 KB |
8 | .Dd "" |
9 | .Dt TCGETPGRP 3 | |
0ae9fc64 MT |
10 | .Os |
11 | .Sh NAME | |
12 | .Nm tcgetpgrp | |
d365c391 KB |
13 | .Nd get foreground process group ID |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/types.h> | |
6175c3fa | 16 | .Fd #include <unistd.h> |
d365c391 KB |
17 | .Ft pid_t |
18 | .Fn tcgetpgrp "int fd" | |
19 | .Sh DESCRIPTION | |
20 | The | |
21 | .Nm tcgetpgrp | |
22 | function returns the value of the process group ID of the foreground | |
23 | process group associated with the terminal device. | |
24 | If there is no foreground process group, | |
25 | .Nm tcgetpgrp | |
26 | returns an invalid process ID. | |
27 | .Sh ERRORS | |
28 | If an error occurs, | |
29 | .Nm tcgetpgrp | |
30 | returns -1 and the global variable | |
31 | .Va errno | |
32 | is set to indicate the error, as follows: | |
33 | .Bl -tag -width Er | |
34 | .It Bq Er EBADF | |
35 | The | |
36 | .Fa fd | |
37 | argument is not a valid file descriptor. | |
38 | .It Bq Er ENOTTY | |
39 | The calling process does not have a controlling terminal or the | |
40 | underlying terminal device represented by | |
41 | .Fa fd | |
42 | is not the controlling terminal. | |
43 | .El | |
44 | .Sh SEE ALSO | |
45 | .Xr setpgid 3 , | |
46 | .Xr setsid 2 , | |
47 | .Xr tcsetpgrp 3 | |
48 | .Sh STANDARDS | |
49 | The | |
50 | .Nm tcgetpgrp | |
51 | function is expected to be compliant with the | |
52 | .St -p1003.1-88 | |
53 | specification. |