isatty - test whether a file descriptor refers to a terminal
#include <unistd.h>
int isatty(int fd);
The isatty() function tests whether fd is an open file descriptor referring to a terminal.
isatty() returns 1 if fd is an open file descriptor referring to a terminal; otherwise 0 is returned, and errno is set to indicate the error.
- EBADF
- fd가 유효한 파일 기술자가 아니다.
- ENOTTY
- fd refers to a file other than a terminal. On some older kernels, some types of files resulted in the error EINVAL in this case (which is a violation of POSIX, which specifies the error ENOTTY).
이 섹션에서 사용되는 용어에 대한 설명은 attributes(7)EN을 참조하십시오.
| 상호 작용 | 속성 | 번호 |
| isatty() | Thread safety | MT-Safe |
POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.