1ISATTY(3)                  Linux Programmer's Manual                 ISATTY(3)
2
3
4

NAME

6       isatty - test whether a file descriptor refers to a terminal
7

SYNOPSIS

9       #include <unistd.h>
10
11       int isatty(int fd);
12

DESCRIPTION

14       The  isatty()  function  tests  whether  fd  is an open file descriptor
15       referring to a terminal.
16

RETURN VALUE

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

ERRORS

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

CONFORMING TO

28       SVr4, 4.3BSD, POSIX.1-2001.
29

SEE ALSO

31       fstat(2), ttyname(3)
32

COLOPHON

34       This page is part of release 3.53 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)
Impressum