Linux Standard Base Core Specification 3.0Preview1 | ||
---|---|---|
<<< Previous | Next >>> |
The gzseek() function shall set the file-position indicator for the compressed file stream file. The file-position indicator controls where the next read or write operation on the compressed file stream shall take place. The offset indicates a byte offset in the uncompressed data. The whence parameter may be one of:
SEEK_SET
the offset is relative to the start of the uncompressed data.
SEEK_CUR
the offset is relative to the current positition in the uncompressed data.
Note: The value
SEEK_END
need not be supported.
If the file is open for writing, the new offset must be greater than or equal to the current offset. In this case, gzseek() shall compress a sequence of null bytes to fill the gap from the previous offset to the new offset.
On success, gzseek() shall return the resulting offset in the file expressed as a byte position in the uncompressed data stream. On error, gzseek() shall return -1, and may set the error value for file accordingly.
On error, gzseek() shall return -1. The following conditions shall always result in an error:
file is NULL
file does not represent an open compressed file stream.
file refers to a compressed file stream that is open for writing, and the newly computed offset is less than the current offset.
The newly computed offset is less than zero.
whence is not one of the supported values.
If file is open for reading, the implementation may still need to uncompress all of the data up to the new offset. As a result, gzseek() may be extremely slow in some circumstances.
<<< Previous | Home | Next >>> |
gzrewind | Up | gzsetparams |