isatty - ファイルディスクリプターが端末を参照しているかをチェックする
#include <unistd.h>
int isatty(int fd);
isatty() 関数は、 fd が端末を参照するオープンされたファイルディスクリプターかどうかを チェックする。
isatty() は、 fd が端末を参照するオープンされたファイルディスクリプターであれば 1 を返す。 そうでなければ 0 を返し、 errno にエラーを示す値を設定する。
- 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.
この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。