1ISATTY(3) Linux Programmer's Manual ISATTY(3)
2
3
4
6 isatty - test whether a file descriptor refers to a terminal
7
9 #include <unistd.h>
10
11 int isatty(int fd);
12
14 The isatty() function tests whether fd is an open file descriptor
15 referring to a terminal.
16
18 isatty() returns 1 if fd is an open file descriptor referring to a ter‐
19 minal; otherwise 0 is returned, and errno is set to indicate the error.
20
22 EBADF fd is not a valid file descriptor.
23
24 EINVAL fd refers to a file other than a terminal. POSIX.1-2001 speci‐
25 fies the error ENOTTY for this case.
26
28 SVr4, 4.3BSD, POSIX.1-2001.
29
31 fstat(2), ttyname(3)
32
34 This page is part of release 3.22 of the Linux man-pages project. A
35 description of the project, and information about reporting bugs, can
36 be found at http://www.kernel.org/doc/man-pages/.
37
38
39
40Linux 2008-12-03 ISATTY(3)