]>
Commit | Line | Data |
---|---|---|
59e0d9fe A |
1 | .\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. |
2 | .\" | |
3 | .\" @APPLE_LICENSE_HEADER_START@ | |
4 | .\" | |
5 | .\" The contents of this file constitute Original Code as defined in and | |
6 | .\" are subject to the Apple Public Source License Version 1.1 (the | |
7 | .\" "License"). You may not use this file except in compliance with the | |
8 | .\" License. Please obtain a copy of the License at | |
9 | .\" http://www.apple.com/publicsource and read it before using this file. | |
10 | .\" | |
11 | .\" This Original Code and all software distributed under the License are | |
12 | .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
13 | .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
14 | .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
15 | .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | |
16 | .\" License for the specific language governing rights and limitations | |
17 | .\" under the License. | |
18 | .\" | |
19 | .\" @APPLE_LICENSE_HEADER_END@ | |
20 | .\" | |
21 | .Dd December 20, 2003 | |
22 | .Dt tcgetsid 3 | |
23 | .Os | |
24 | .Sh NAME | |
25 | .Nm tcgetsid | |
26 | .Nd get the process group ID for the session leader for the controlling terminal | |
27 | .Sh SYNOPSIS | |
28 | .In termios.h | |
29 | .Ft pid_t | |
30 | .Fn tcgetsid "int fildes" | |
31 | .Sh DESCRIPTION | |
32 | The | |
33 | .Fn tcgetsid | |
34 | function obtains the process group ID of the session for which the terminal | |
35 | specified by | |
36 | .Fa fildes | |
37 | is the controlling terminal. | |
38 | .Sh RETURN VALUES | |
39 | Upon successful completion, | |
40 | .Fn tcgetsid | |
41 | returns the process group ID associated with the terminal. | |
42 | Otherwise, a value of | |
43 | .Po Vt pid_t Pc Ns -1 | |
44 | is returned and | |
45 | .Va errno | |
46 | is set to indicate the error. | |
47 | .Sh ERRORS | |
48 | The | |
49 | .Fn tcgetsid | |
50 | function will fail if: | |
51 | .Bl -tag -width Er | |
52 | .It Bq Er EACCES | |
53 | The | |
54 | .Vt fildes | |
55 | argument is not associated with a controlling terminal. | |
56 | .It Bq Er EBADF | |
57 | The | |
58 | .Vt fildes | |
59 | argument is not a valid file descriptor. | |
60 | .It Bq Er ENOTTY | |
61 | The file associated with | |
62 | .Vt fildes | |
63 | is not a terminal. | |
64 | .El | |
65 | .Sh SEE ALSO | |
66 | .Xr getsid 2 , | |
67 | .Xr setpgid 2 , | |
68 | .Xr setsid 2 , | |
69 | .Xr tcgetpgrp 3 , | |
70 | .Xr termios 4 | |
71 | .Sh STANDARDS | |
72 | The | |
73 | .Fn tcgetsid | |
74 | function conforms to | |
75 | .St -p1003.1-2001 . |