isatty

Tests whether the specified file descriptor refers to a terminal device.

Library:LibC
Classification:POSIX
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  int isatty (
     int   fildes);
  

Parameters

fildes

(IN) Specifies the file descriptor to test.

Return Values

Returns

Decimal

Constant

Description

4

EBADF

The fildes parameter isn't a valid file descriptor.

75

ENOTTY

The fildes parameter doesn't refer to a terminal device.

Remarks

The isatty function tests if the opened file or device referenced by the file descriptor is a character device (namely, the console).

See Also