50 lines
1.9 KiB
HTML
50 lines
1.9 KiB
HTML
<html><!-- This HTML file has been created by texi2html 1.29
|
|
from syscalls.texi on 4 June 1994 -->
|
|
|
|
<TITLE>Syscall specifications of Linux - lseek</TITLE>
|
|
<P>Go to the <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">next</A> section.<P>
|
|
<H2><A NAME="SEC19" HREF="syscalls_toc.html#SEC19" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC19">lseek</A></H2>
|
|
<P>
|
|
<H3>SYNOPSIS</H3>
|
|
<P>
|
|
<CODE>off_t lseek(int <VAR>fd</VAR>, off_t <VAR>offset</VAR>, int <VAR>whence</VAR>);</CODE>
|
|
<P>
|
|
<H3>PARAMETERS</H3>
|
|
<P>
|
|
<VAR>fd</VAR>: [in] the file descriptor to manipulate.
|
|
<P>
|
|
<VAR>offset</VAR>: [in] the offset modificator.
|
|
<P>
|
|
<VAR>whence</VAR>: [in] indicates how to modify the offset.
|
|
<P>
|
|
<H3>DESCRIPTION</H3>
|
|
<P>
|
|
Changes the read/write file offset of a file descriptor. The
|
|
<VAR>offset</VAR> parameter is interpreted according to the possible
|
|
following values of <VAR>whence</VAR>:
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT><CODE>SEEK_SET</CODE>
|
|
<DD>the new file offset will be <VAR>offset</VAR>.
|
|
<P>
|
|
<DT><CODE>SEEK_CUR</CODE>
|
|
<DD>the new file offset will be the current offset plus <VAR>offset</VAR>.
|
|
<P>
|
|
<DT><CODE>SEEK_END</CODE>
|
|
<DD>the new file offset will be the end of the file plus <VAR>offset</VAR>.
|
|
</DL>
|
|
<P>
|
|
If we seek past the end of a file, the new file region contain 0.
|
|
<P>
|
|
<H3>RETURN VALUE</H3>
|
|
<P>
|
|
On success, the call returns the new file offset. On errror, it returns
|
|
-1 and sets <CODE>errno</CODE> to one of the following values:
|
|
<P>
|
|
<UL>
|
|
<LI><CODE>EINVAL</CODE>: <VAR>whence</VAR> does not have a valid value.
|
|
<LI><CODE>EBADF</CODE>.
|
|
</UL>
|
|
<P>
|
|
<P>Go to the <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">next</A> section.<P>
|