Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 8
Test to see if a file descriptor is associated with a terminal
#include <unistd.h>
int isatty( int fildes );
- fildes
- The file descriptor that you want to test.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The isatty() function allows the calling process to determine if
the file descriptor fildes is associated with a terminal.
- 0
- The fildes file descriptor doesn't refer to a terminal.
- 1
- The fildes file descriptor refers to a terminal.
/*
* The following program exits with a status of
* EXIT_SUCCESS if stderr is a tty; otherwise,
* EXIT_FAILURE
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main( void )
{
return( isatty( 3 ) ? EXIT_SUCCESS : EXIT_FAILURE );
}
POSIX 1003.1
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
open()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 134
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/isatty.html on line 134