gfal_lseek(3) - Linux man page
Name
gfal_lseek - position a fileSynopsis
off_t gfal_lseek (int fd, off_t offset, int whence);
Under Linux, for large files:
#define _LARGEFILE64_SOURCE
#include "gfal_api.h"
off64_t gfal_lseek64 (int fd, off64_t offset, int whence);
For large files, under other systems:
#include "gfal_api.h"
off64_t gfal_lseek64 (int fd, off64_t offset, int whence);
Description
gfal_lseek positions/repositions to offset the file associated with the descriptor fd generated by a previous gfal_open. whence indicates how to interpret the offset value:
- SEEK_SET
- The offset is set from beginning of file.
- SEEK_CUR
- The offset is added to current position.
- SEEK_END
- The offset is added to current file size.
gfal_lseek64 performs the same function on large files using off64_t rather than off_t.
Return Value
This routine returns the actual offset from the beginning of the file if the operation was successful or -1 if the operation failed. In the latter case, errno is set appropriately.Errors
- EBADF
- fd is not a valid file descriptor.
- EINVAL
- incorrect value for whence.
- EFBIG
- Resulting offset is too big to fit in off_t.
- ECOMM
- Communication error.
- EPROTONOSUPPORT
- Access method not supported.