You copied the Doc URL to your clipboard.
_sys_istty()
Declared in rt_sys.h, the _sys_istty()
function determines whether a file handle is attached to an interactive device.
Syntax
int
_sys_istty(FILEHANDLEfh
);
Usage
The Arm libraries call __sys_istty()
to
determine whether a file handle (that is being used for an output file stream) is attached
to an interactive device.
For file streams that are attached to interactive devices, the Arm library:
- Provides unbuffered behavior by default, in the absence of a call to
setbuf()
orsetvbuf()
. - Prohibits seeking.
Restriction
stdin
, stdout
, and stderr
are assumed to be
interactive devices. They are line-buffered at program startup, regardless of what
_sys_istty
reports for them. An exception is if they have been redirected
on the command line.
Note
This restriction does not apply when using microlib. In microlib,stdin
, stdout
, and stderr
are always
unbuffered.Returns
The return value is one of the following values:
- 0
fh
is not attached to an interactive device.- 1
fh
is attached to an interactive device.- other
- An error occurred.