isfdtype - test file type of a file descriptor
#include <sys/stat.h>
#include <sys/socket.h>
int isfdtype(int fd, int fdtype);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
The isfdtype() function returns 1 if the file descriptor fd
is of type fdtype
and 0 if it is not. On error, -1 is returned and errno
is set to indicate the cause.
fstat(3)