diff options
Diffstat (limited to 'lib/libc/stdio/ferror.3')
-rw-r--r-- | lib/libc/stdio/ferror.3 | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/libc/stdio/ferror.3 b/lib/libc/stdio/ferror.3 index 1529c002fb7f..b921c4280607 100644 --- a/lib/libc/stdio/ferror.3 +++ b/lib/libc/stdio/ferror.3 @@ -29,8 +29,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)ferror.3 8.2 (Berkeley) 4/19/94 -.\" .Dd April 2, 2022 .Dt FERROR 3 .Os @@ -112,9 +110,25 @@ before calling them. These functions may be used to avoid the overhead of locking the stream and to prevent races when multiple threads are operating on the same stream. .Sh ERRORS -These functions should not fail and do not set the external -variable +These functions, except +.Fn fileno , +should not fail and do not set the external variable .Va errno . +.Pp +On error, +.Fn fileno +returns \-1 and sets +.Va errno +to one of the following values: +.Bl -tag -width Er +.It Bq Er EBADF +The stream is not associated with a file. +.It Bq Er EBADF +The file descriptor underlying stream is not a valid file descriptor. +.Pp +Note that detection of this condition is not reliable, the error might +be not reported. +.El .Sh SEE ALSO .Xr open 2 , .Xr fdopen 3 , |