⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscalls_19.html

📁 Linux系统调用
💻 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://personal.xfol.com/%7erezaie/syscall/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_20.html">next</A> section.<P>
<H2><A NAME="SEC19" HREF="syscalls_toc.html#SEC19" tppabs="http://personal.xfol.com/%7erezaie/syscall/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://personal.xfol.com/%7erezaie/syscall/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_20.html">next</A> section.<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -