-.\" $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.
.\" 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
.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