SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
off_t lseek(int fildes, off_t offset, int whence);
off64_t lseek64(int fildes, off64_t offset, int whence);
DESCRIPTION
The
- If whence is SEEK_SET, the offset is set to offset bytes.
- If whence is SEEK_CUR, the offset is set to its current value plus offset bytes.
- If whence is SEEK_END, the offset is set to the size of the file plus offset bytes.
The
The
The
Some devices cannot seek. The value of the file pointer associated with a non-seeking device is undefined.
PARAMETERS
- fildes
-
Is the file descriptor of an open file.
- offset
-
Specifies the number of bytes to offset the file pointer from a specified file origin.
- whence
-
Specifies the location from which to start seeking.
RETURN VALUES
If successful,
- EBADF
-
fildes is not a valid file descriptor.
- EINVAL
-
whence is not a proper value (SEEK_SET, SEEK_CUR, or SEEK_END), or the resulting file offset would be invalid.
- EISDIR
-
fildes is associated with a directory.
- EOVERFLOW
-
The resulting file offset would be a value which cannot be represented correctly in an object of type off_t.
- ESPIPE
-
fildes is associated with a pipe or FIFO.
CONFORMANCE
POSIX.1 (1996).
MULTITHREAD SAFETY LEVEL
Async-signal-safe.
PORTING ISSUES
When performing I/O to text mode files, the return value from
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Miscellaneous:
- lf64
PTC MKS Toolkit 10.5 Documentation Build 40.