LSEEK - reposition read/write pointer.
(Compatible with UNIX System V C)
ret = lseek( fd, offset, begin );
- int fd;
- is a valid file descriptor as returned by
"open" or "creat".
- long offset;
- gives the offset of the desired position (in bytes).
- int begin;
- indicates where to begin repositioning. If
"begin" is 0, the pointer is set to
"offset" bytes from the beginning of the file.
If "begin" is 1, the pointer is set to
"offset" bytes from the current location in the
file. If "begin" is 2, the pointer is set to
"offset" bytes beyond the current end of the
- long ret;
- is the new offset of the pointer (in bytes) from the
beginning of the file. If the operation failed, a -1 is
returned and the library variable "errno" is
set to indicate the error (see below).
"lseek" moves the read/write file pointer inside a
given file. Note that seeking is not permitted on some devices;
in such cases, the value of the file pointer is undefined.
- the "fd" value was invalid.
- "begin" was invalid, or any other failure.
expl c lib errno
expl c include fildes
Copyright © 1996, Thinkage Ltd.