xdf_seek3
Move the sample pointer of a xdf file
Usage
#include <xdfio.h>
off_t xdf_seek(struct xdf* xdf, off_t offset, int whence);
Overview
xdf_seek() repositions the current sample pointer according to the couple (offset,whence) where whence can be:
|
The offset is set to offset bytes. |
|---|---|
|
The offset is set to its current location plus offset bytes. |
|
The offset is set to the size of the file plus offset bytes. |
The file referenced by xdf should have been opened with mode XDF_READ and xdf_prepare_arrays(3) should have been successfully called on it.
Return value
Upon successful completion, xdf_seek() returns the resulting offset location as measured in number of samples from the beginning of the recording. Otherwise, a value of -1 is returned and errno is set to indicate the error.
Errors
- EINVAL
-
xdf is NULL or whence is none of the allowed values.
- EPERM
-
No successfull call to xdf_prepare_transfer(3) have been done on xdf or it has been opened using the mode
XDF_WRITE.
- ERANGE
-
The requested offset is out of the range of the recording.
- EINTR
-
The call was interrupted by a signal before any data was read; see signal(7).
- EIO
-
A low-level I/O error occurred while reading from the inode.
- ESTALE
-
Stale file handle. This error can occur for NFS and for other file systems
Releases
Unchanged in 7 releases since Debian 7 (Wheezy).