summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2021-10-31 16:56:48 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2021-10-31 16:56:48 +0000
commita8bd679fa56b02fb7bd438a367b89bc3f9b652bd (patch)
treef018142761d93ee0506a0a70f871a3793ac7fa56
parent574753cd4390a5de2ca0c10c84bbd9eddd9b00b2 (diff)
document that fileno(3) returns -1 for some kinds of FILE * objects;
triggerd by but simpler than a similar patch sent in by Simon Branch <simonmbranch at gmail dot com>; OK millert@ jmc@
-rw-r--r--lib/libc/stdio/ferror.313
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libc/stdio/ferror.3 b/lib/libc/stdio/ferror.3
index 526c07e32a8..0f0bdf21f9e 100644
--- a/lib/libc/stdio/ferror.3
+++ b/lib/libc/stdio/ferror.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ferror.3,v 1.10 2013/07/17 05:42:11 schwarze Exp $
+.\" $OpenBSD: ferror.3,v 1.11 2021/10/31 16:56:47 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 17 2013 $
+.Dd $Mdocdate: October 31 2021 $
.Dt FERROR 3
.Os
.Sh NAME
@@ -73,9 +73,14 @@ function.
.Pp
The function
.Fn fileno
-examines the argument
+returns the file descriptor associated with the given
.Fa stream
-and returns its integer file descriptor.
+or \-1 if it is not associated with any file descriptor,
+for example if it was created with
+.Xr fmemopen 3 ,
+.Xr open_memstream 3 ,
+or
+.Xr funopen 3 .
.Sh ERRORS
These functions should not fail and do not set the external
variable