| Updated: October 28, 2024 |
Test the file type of a file descriptor
#include <sys/stat.h>
int isfdtype( int filedes,
int fdtype );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The isfdtype() function determines whether the file descriptor filedes refers to a file of the type fdtype.
if ((buf.st_mode & S_IFMT) == fdtype)
/* The file descriptor matches fdtype. */
else
/* The file descriptor doesn't match fdtype. */
Any value from the errors section in fstat().
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |