Defined in rt_sys.h, the _sys_istty() function determines if a file handle identifies a terminal.
int _sys_istty(FILEHANDLE fh);
When a file is connected to a terminal device, this function provides unbuffered behavior by default (in the absence of a call to set(v)buf) and prohibits seeking.
The return value is one of the following values:
There is no interactive device.
There is an interactive device.
An error occurred.