From: schwarze Date: Sun, 31 Oct 2021 16:56:47 +0000 (+0000) Subject: document that fileno(3) returns -1 for some kinds of FILE * objects; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b480c65e140f26f64a28fd3a669b10e480af82d0;p=openbsd 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 ; OK millert@ jmc@ --- 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