]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/ferror.3
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man3 / ferror.3
index a3fe785e4cc3e7b5017a4430fd76cbe949dda5aa..d866edcbad4ab869faa7d3aa9ddca5dd290ec4fc 100644 (file)
 .\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu
 .\" Added remark on EBADF for fileno, aeb, 2001-03-22
 .\"
-.TH FERROR 3  2008-08-29 "" "Linux Programmer's Manual"
+.TH FERROR 3  2019-03-06 "" "Linux Programmer's Manual"
 .SH NAME
 clearerr, feof, ferror, fileno \- check and reset stream status
 .SH SYNOPSIS
 .B #include <stdio.h>
-.sp
+.PP
 .BI "void clearerr(FILE *" stream );
-
+.PP
 .BI "int feof(FILE *" stream );
-
+.PP
 .BI "int ferror(FILE *" stream );
-
+.PP
 .BI "int fileno(FILE *" stream );
-.sp
+.PP
 .in -4n
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
 .in
-.sp
+.PP
 .BR fileno ():
-_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
+_POSIX_C_SOURCE
 .SH DESCRIPTION
 The function
 .BR clearerr ()
@@ -89,7 +89,15 @@ The function
 .BR fileno ()
 examines the argument
 .I stream
-and returns its integer descriptor.
+and returns the integer file descriptor used to implement this stream.
+The file descriptor is still owned by
+.I stream
+and will be closed when
+.BR fclose (3)
+is called.
+Duplicate the file descriptor with
+.BR dup (2)
+before passing it to code that might close it.
 .PP
 For nonlocking counterparts, see
 .BR unlocked_stdio (3).
@@ -104,21 +112,32 @@ return \-1 and set
 to
 .BR EBADF .)
 .SH ATTRIBUTES
-.SS Multithreading (see pthreads(7))
-The
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbw19 lb lb
+l l l.
+Interface      Attribute       Value
+T{
 .BR clearerr (),
 .BR feof (),
+.br
 .BR ferror (),
-and
 .BR fileno ()
-functions are thread-safe.
+T}     Thread safety   MT-Safe
+.TE
 .SH CONFORMING TO
 The functions
 .BR clearerr (),
 .BR feof (),
 and
 .BR ferror ()
-conform to C89 and C99.
+conform to C89, C99, POSIX.1-2001, and POSIX.1-2008.
+.PP
+The function
+.BR fileno ()
+conforms to POSIX.1-2001 and POSIX.1-2008.
 .SH SEE ALSO
 .BR open (2),
 .BR fdopen (3),