A function with same signature and semantics than fread.
Some details from the Linux man pages:
"On success, fread() and fwrite() return the number of items read
or written. This number equals the number of bytes transferred
only when size is 1. If an error occurs, or the end of the file
is reached, the return value is a short item count (or zero).
The file position indicator for the stream is advanced by the
number of bytes successfully read or written.
fread() does not distinguish between end-of-file and error, and
callers must use feof() and ferror() to determine which
occurred. (well, ferror not available in gamut).
A function with same signature and semantics than fread.
Some details from the Linux man pages:
"On success, fread() and fwrite() return the number of items read or written. This number equals the number of bytes transferred only when size is 1. If an error occurs, or the end of the file is reached, the return value is a short item count (or zero).
The file position indicator for the stream is advanced by the number of bytes successfully read or written.
fread() does not distinguish between end-of-file and error, and callers must use feof() and ferror() to determine which occurred. (well, ferror not available in gamut).