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