4.43 _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(FILEHANDLE fh);

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() or setvbuf().
  • 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.

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.
Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.