man-pages/man3/isfdtype.3.html
2021-03-31 01:06:50 +01:00

160 lines
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ISFDTYPE</TITLE>
</HEAD><BODY>
<H1>ISFDTYPE</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2014-03-13<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
isfdtype - test file type of a file descriptor
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/sys/stat.h">sys/stat.h</A>&gt;</B>
<B>#include &lt;<A HREF="file:///usr/include/sys/socket.h">sys/socket.h</A>&gt;</B>
<B>int isfdtype(int </B><I>fd</I><B>, int </B><I>fdtype</I><B>);</B>
</PRE>
<P>
Feature Test Macro Requirements for glibc (see
<B><A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A></B>(7)):
<P>
<B>isfdtype</B>():
<DL COMPACT><DT id="1"><DD>
<DL COMPACT>
<DT id="2">Since glibc 2.20:<DD>
_DEFAULT_SOURCE
<DT id="3">Before glibc 2.20:<DD>
_BSD_SOURCE || _SVID_SOURCE
</DL>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The
<B>isfdtype</B>()
function tests whether the file descriptor
<I>fd</I>
refers to a file of type
<I>fdtype</I>.
The
<I>fdtype</I>
argument specifies one of the
<B>S_IF*</B>
constants defined in
<I>&lt;<A HREF="file:///usr/include/sys/stat.h">sys/stat.h</A>&gt;</I>
and documented in
<B><A HREF="/cgi-bin/man/man2html?2+stat">stat</A></B>(2)
(e.g.,
<B>S_IFREG</B>).
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
The
<B>isfdtype</B>()
function returns 1 if the file descriptor
<I>fd</I>
is of type
<I>fdtype</I>
and 0 if it is not.
On error, -1 is returned and
<I>errno</I>
is set to indicate the cause.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
The
<B>isfdtype</B>()
function can fail with any of the same errors as
<B><A HREF="/cgi-bin/man/man2html?3+fstat">fstat</A></B>(3).
<A NAME="lbAG">&nbsp;</A>
<H2>CONFORMING TO</H2>
The
<B>isfdtype</B>()
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
<I>&lt;<A HREF="file:///usr/include/sys/stat.h">sys/stat.h</A>&gt;</I>,
as shown in the POSIX.1g draft),
and possibly other systems.
<A NAME="lbAH">&nbsp;</A>
<H2>NOTES</H2>
Portable applications should use
<B><A HREF="/cgi-bin/man/man2html?3+fstat">fstat</A></B>(3)
instead.
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+fstat">fstat</A></B>(3)
<A NAME="lbAJ">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="8"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="9"><A HREF="#lbAG">CONFORMING TO</A><DD>
<DT id="10"><A HREF="#lbAH">NOTES</A><DD>
<DT id="11"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="12"><A HREF="#lbAJ">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:46 GMT, March 31, 2021
</BODY>
</HTML>