1 .\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH ISFDTYPE 3 2020-08-13 "Linux" "Linux Programmer's Manual"
27 isfdtype \- test file type of a file descriptor
30 .B #include <sys/stat.h>
31 .B #include <sys/socket.h>
33 .BI "int isfdtype(int " fd ", int " fdtype );
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
46 _BSD_SOURCE || _SVID_SOURCE
51 function tests whether the file descriptor
53 refers to a file of type
57 argument specifies one of the
68 function returns 1 if the file descriptor
73 On failure, \-1 is returned and
75 is set to indicate the error.
79 function can fail with any of the same errors as
84 function is not specified in any standard,
85 but did appear in the draft POSIX.1g standard.
86 It is present on OpenBSD and Tru64 UNIX
87 (where the required header file in both cases is just
89 as shown in the POSIX.1g draft),
90 and possibly other systems.
92 Portable applications should use