Sponsor:

Your company here, and a link to your site. Click to find out more.

isatty - Man Page

test for a terminal device

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.

Synopsis

#include <unistd.h>

int isatty(int fildes);

Description

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.

See Also

The Base Definitions volume of POSIX.1-2017, <unistd.h>

Referenced By

tty(1p), unistd.h(0p).

2017 IEEE/The Open Group POSIX Programmer's Manual