isatty

Section: C Library Functions (3)
Updated: 2025-05-17
Index JM Home Page roff page
 

名前

isatty - ファイルディスクリプターが端末を参照しているかをチェックする  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#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) を参照。
インターフェース属性値
isatty() Thread safetyMT-Safe
 

標準規格

POSIX.1-2008.  

歴史

POSIX.1-2001, SVr4, 4.3BSD.  

関連項目

fstat(2), ttyname(3)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.