Purpose
Determines whether a device is a terminal on the home node.
Library
libmpi.a
C synopsis
#include <pm_util.h> int mpc_isatty(int FileDescriptor);
Parameters
Description
This parallel utility subroutine determines whether the file descriptor specified by the FileDescriptor parameter is associated with a terminal device on the home node. In a parallel operating environment partition, these three file descriptors are implemented as pipes to the partition manager daemon. Therefore, the AIX isatty() subroutine will always return false for each of them. This subroutine is provided for use by remote tasks that may want to know whether one of these devices is actually a terminal on the home node, for example, to determine whether or not to output a prompt.
Notes
This subroutine has a C version only. Also, it is thread safe.
Return values
In C and C++ calls, the following applies:
Examples
C Example
/*
* Running this program, after compiling with mpcc,
* without redirecting STDIN, produces the following output:
*
* isatty() reports STDIN as a non-terminal device
* mpc_isatty() reports STDIN as a terminal device
*/
#include "pm_util.h"
main()
{
if (isatty(STDIN)) {
printf("isatty() reports STDIN as a terminal device\n");
} else {
printf("isatty() reports STDIN as a non-terminal device\n");
if (mpc_isatty(STDIN)) {
printf("mpc_isatty() reports STDIN as a terminal device\n");
} else {
printf("mpc_isatty() reports STDIN as a non-terminal device\n");
}
}
}