isastream() — Test a file descriptor
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both |
Format
#define _XOPEN_SOURCE_EXTENDED 1
#include <stropts.h>
int isastream(int fildes);
General description
The isastream() function tests whether filedes, an open file descriptor, is associated with a STREAMS-based file.
Returned value
If successful, isastream() returns 1 if fildes refers to a STREAMS-based file and 0 if not.
If unsuccessful, isastream() returns -1 and sets errno to one of the following values.
Note: z/OS® UNIX services
do not supply any STREAMS devices or pseudodevices. It is impossible
for isastream() to return 1 since there are no STREAMS-based file
descriptors. It will return 0 unless fildes is
not a valid open file descriptor, in which case it will return -1
with errno set to indicate the failure. See open() — Open a file
- Error Code
- Description
- EBADF
- The fildes argument is not a valid open file descriptor.