]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/isatty.3
futex.2, netlink.3, stdin.3, wavelan.4, netlink.7: srcfix
[thirdparty/man-pages.git] / man3 / isatty.3
CommitLineData
fac98546
MK
1.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
2.\" <mtk.manpages@gmail.com>
fea681da 3.\"
fac98546
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
fea681da 7.\"
fac98546
MK
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
fea681da 12.\"
fac98546
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
fea681da 20.\"
fac98546
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
c13182ef 23.\"
fac98546 24.TH ISATTY 3 2008-12-03 "Linux" "Linux Programmer's Manual"
fea681da 25.SH NAME
fac98546 26isatty \- test whether a file descriptor refers to a terminal
fea681da 27.SH SYNOPSIS
fea681da
MK
28.nf
29.B #include <unistd.h>
30.sp
fac98546 31.BI "int isatty(int " fd );
fea681da 32.fi
fea681da 33.SH DESCRIPTION
fac98546 34The
0c637bbd
MK
35.BR isatty ()
36function tests whether
fac98546
MK
37.I fd
38is an open file descriptor referring to a terminal.
39.SH RETURN VALUE
0c637bbd 40.BR isatty ()
fac98546
MK
41returns 1 if
42.I fd
43is an open file descriptor referring to a terminal;
44otherwise 0 is returned, and
45.I errno
46is set to indicate the error.
47.SH ERRORS
48.TP
49.B EBADF
50.I fd
51is not a valid file descriptor.
52.TP
53.B EINVAL
54.I fd
55refers to a file other than a terminal.
56POSIX.1-2001 specifies the error
57.BR ENOTTY
58.\" FIXME File a bug for this?
59for this case.
47297adb 60.SH CONFORMING TO
68e1685c 61SVr4, 4.3BSD, POSIX.1-2001.
47297adb 62.SH SEE ALSO
fea681da
MK
63.BR fstat (2),
64.BR ttyname (3)