]> git.saurik.com Git - apple/libc.git/blob - emulated/tcgetsid.3
Libc-763.11.tar.gz
[apple/libc.git] / emulated / tcgetsid.3
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 .Fo tcgetsid
31 .Fa "int fildes"
32 .Fc
33 .Sh DESCRIPTION
34 The
35 .Fn tcgetsid
36 function obtains the process group ID of the session for which the terminal
37 specified by
38 .Fa fildes
39 is the controlling terminal.
40 .Sh RETURN VALUES
41 Upon successful completion,
42 .Fn tcgetsid
43 returns the process group ID associated with the terminal.
44 Otherwise, a value of
45 .Po Vt pid_t Pc Ns -1
46 is returned and
47 .Va errno
48 is set to indicate the error.
49 .Sh ERRORS
50 The
51 .Fn tcgetsid
52 function will fail if:
53 .Bl -tag -width Er
54 .It Bq Er EACCES
55 The
56 .Vt fildes
57 argument is not associated with a controlling terminal.
58 .It Bq Er EBADF
59 The
60 .Vt fildes
61 argument is not a valid file descriptor.
62 .It Bq Er ENOTTY
63 The file associated with
64 .Vt fildes
65 is not a terminal.
66 .El
67 .Sh SEE ALSO
68 .Xr getsid 2 ,
69 .Xr setpgid 2 ,
70 .Xr setsid 2 ,
71 .Xr tcgetpgrp 3 ,
72 .Xr termios 4
73 .Sh STANDARDS
74 The
75 .Fn tcgetsid
76 function conforms to
77 .St -p1003.1-2001 .