isatty3p
Test for a terminal device
Usage
#include <unistd.h>
int isatty(int fildes);
Prolog
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
Overview
The isatty() function shall test whether fildes, an open file descriptor, is associated with a terminal device.
Return value
The isatty() function shall return 1 if fildes is associated with a terminal; otherwise, it shall return 0 and may set errno to indicate the error.
Errors
The isatty() function may fail if:
EBADF
|
The fildes argument is not a valid open file descriptor. |
|---|---|
ENOTTY
|
The file associated with the fildes argument is not a terminal. |
The following sections are informative.
Examples
None.
Application usage
The isatty() function does not necessarily indicate that a human being is available for interaction via fildes. It is quite possible that non-terminal devices are connected to the communications line.
Rationale
None.
Future directions
None.