diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2014-03-13 10:50:59 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2014-08-18 17:24:32 -0500 |
| commit | af81e9cd97ba7813d6f2f34f6158575aadfa0aef (patch) | |
| tree | fa672b395b792c628eb79d05652098492d636715 /man3 | |
| parent | 94ed3bb9c64e973ff6db8d719dfc21323d0735a7 (diff) | |
| download | man-pages-af81e9cd97ba7813d6f2f34f6158575aadfa0aef.tar.gz | |
isfdtype.3: New page documenting isfdtype(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/isfdtype.3 | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/man3/isfdtype.3 b/man3/isfdtype.3 new file mode 100644 index 0000000000..bd7414ee82 --- /dev/null +++ b/man3/isfdtype.3 @@ -0,0 +1,103 @@ +'\" t +.\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com> +.\" +.\" %%%LICENSE_START(VERBATIM) +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END +.\" +.TH ISFDTYPE 3 2014-03-13 "Linux" "Linux Programmer's Manual" +.SH NAME +isfdtype \- test file type of a file descriptor +.SH SYNOPSIS +.nf +.B #include <sys/stat.h> +.B #include <sys/socket.h> + +.BI "int isfdtype(int " fd ", int" fdtype ); +.fi +.sp +.in -4n +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.in +.sp +.BR isfdtype (): +.ad l +.RS 4 +.PD 0 +.TP 4 +Since glibc 2.20: +_DEFAULT_SOURCE +.TP 4 +Before glibc 2.20: +_BSD_SOURCE || _SVID_SOURCE +.PD +.RE +.ad b +.SH DESCRIPTION +The +.BR isfdtype () +function tests whether the file descriptor +.I fd +refers to a file of type +.IR fdtype . +The +.I fdtype +argument specifies one of the +.B S_IF* +constants defined in +.I <sys/stat.h> +and documented in +.BR stat (2) +(e.g., +.BR S_IFREG ). +.SH RETURN VALUE +The +.BR isfdtype () +function returns 1 if the file descriptor +.I fd +is of type +.IR fdtype +and 0 if it is not. +On error, -1 is returned and +.I errno +is set to indicate the cause. +.SH ERRORS +The +.BR isfdtype () +function can fail with any of the same errors as +.BR fstat (3). +.SH CONFORMING TO +The +.BR isfdtype () +function is not specified in any standard, +but did appear in the draft POSIX.1g standard. +It is present on OpenBSD and Tru64 UNIX +(where the required header file in both cases is just +.IR <sys/stat.h> , +as shown in the POSIX.1g draft), +and possibly other systems. +.SH NOTES +Portable applications should use +.BR fstat (3) +instead. +.SH SEE ALSO +.BR fstat (3) |
