From a8bd679fa56b02fb7bd438a367b89bc3f9b652bd Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 31 Oct 2021 16:56:48 +0000 Subject: 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@ --- lib/libc/stdio/ferror.3 | 13 +++++++++---- 1 file 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 -- cgit v1.2.3