FERROR(3C) Standard C Library Functions FERROR(3C)

NAME


ferror, feof, clearerr, fileno - stream status inquiries

SYNOPSIS


#include <stdio.h>

int
ferror(FILE *stream);

int
feof(FILE *stream);

void
clearerr(FILE *stream);

int
fileno(FILE *stream);

DESCRIPTION


The ferror() function returns a non-zero value when an error has previously
occurred reading from or writing to the named stream (see Intro(3)). It
returns 0 otherwise.

The feof() function returns a non-zero value when EOF has previously been
detected reading the named input stream. It returns 0 otherwise.

The clearerr() function resets the error indicator and EOF indicator to 0
on the named stream.

The fileno() function returns the integer file descriptor associated with
the named stream; see open(2). Streams that are not associated with a file
descriptor such as those that were created through the fmemopen(3C) or
open_memstream(3C) functions will return -1.

INTERFACE STABILITY


Standard

MT-LEVEL
MT-Safe

SEE ALSO


Intro(2), open(2), fmemopen(3C), fopen(3C), open_memstream(3C), stdio(3C)

illumos March 25, 2020 illumos