Visible to Intel only — GUID: lwq1653010842792
Ixiasoft
Visible to Intel only — GUID: lwq1653010842792
Ixiasoft
16.1.1.66. lseek()
Prototype
off_t lseek(int fd, off_t ptr, int whence)Commonly Called By
C/C++ programsnewlib C library
Thread-safe
See description.Available from ISR
No.Include
<unistd.h>Description
The lseek() function moves the read/write pointer associated with the file descriptor fd. lseek() is wrapper function that passes control directly to the lseek() function registered for the driver associated with the file descriptor. If the driver does not provide an implementation of lseek(), an error is reported.lseek() corresponds to the standard UNIX lseek() function.
You can use the following values for the input parameter, whence:
- SEEK_SET—The offset is set to ptr bytes.
- SEEK_CUR—The offset is incremented by ptr bytes.
- SEEK_END—The offset is set to the end of the file plus ptr bytes.
Calls to lseek() are thread-safe only if the implementation of lseek() provided by the driver that is manipulated is thread-safe.
Valid values for the fd parameter are: stdout, stdin, and stderr, or any value returned from a call to open().