| Linux Standard Base Core Specification 3.0Preview1 | ||
|---|---|---|
| <<< Previous | Next >>> | |
The gzread() function shall read data from the compressed file referenced by file, which shall have been opened in a read mode (see gzopen() and gzdopen()). The gzread() function shall read data from file, and uncompress it into buf. At most, len bytes of uncompressed data shall be copied to buf. If the file is not compressed, gzread() shall simply copy data from file to buf without alteration.
On success, gzread() shall return the number of bytes
decompressed into buf.
If gzread() returns 0,
either the end-of-file has been reached
or an underlying read error has occurred. Applications
should use gzerror() or gzeof()
to determine which occurred.
On other errors,
gzread() shall return a value less than
0 and
and applications may examine the cause using gzerror().
On error, gzread() shall set the error number associated with the stream identified by file to indicate the error. Applications should use gzerror() to access this error value.
Z_ERRNOAn underlying base library function has indicated an error.
The global variable errno may be examined
for further information.
Z_STREAM_ENDEnd of file has been reached on input.
Z_DATA_ERRORA CRC error occurred when reading data; the file is corrupt.
Z_STREAM_ERRORThe stream is invalid, or is in an invalid state.
Z_NEED_DICTA dictionary is needed (see inflateSetDictionary()).
Z_MEM_ERRORInsufficient memory available to decompress.
| <<< Previous | Home | Next >>> |
| gzputs | Up | gzrewind |