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 specifies
25              the error ENOTTY for this case.
26

ATTRIBUTES

28       For  an  explanation  of  the  terms  used   in   this   section,   see
29       attributes(7).
30
31       ┌──────────┬───────────────┬─────────┐
32Interface Attribute     Value   
33       ├──────────┼───────────────┼─────────┤
34isatty()  │ Thread safety │ MT-Safe │
35       └──────────┴───────────────┴─────────┘

CONFORMING TO

37       POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
38

SEE ALSO

40       fstat(2), ttyname(3)
41

COLOPHON

43       This  page  is  part of release 4.15 of the Linux man-pages project.  A
44       description of the project, information about reporting bugs,  and  the
45       latest     version     of     this    page,    can    be    found    at
46       https://www.kernel.org/doc/man-pages/.
47
48
49
50Linux                             2015-08-08                         ISATTY(3)
Impressum