154 lines
3.5 KiB
HTML
154 lines
3.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LLSEEK</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LLSEEK</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
_llseek - reposition read/write file offset
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/sys/types.h">sys/types.h</A>></B>
|
|
<B>#include <<A HREF="file:///usr/include/unistd.h">unistd.h</A>></B>
|
|
|
|
<B>int _llseek(unsigned int </B><I>fd</I><B>, unsigned long </B><I>offset_high</I><B>,</B>
|
|
<B> unsigned long </B><I>offset_low</I><B>, loff_t *</B><I>result</I><B>,</B>
|
|
<B> unsigned int </B><I>whence</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
<I>Note</I>:
|
|
|
|
There is no glibc wrapper for this system call; see NOTES.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>_llseek</B>()
|
|
|
|
system call repositions the offset of the open file description associated
|
|
with the file descriptor
|
|
<I>fd</I>
|
|
|
|
to
|
|
<I>(offset_high<<32) | offset_low</I>
|
|
|
|
bytes relative to the beginning of the file, the current file offset,
|
|
or the end of the file, depending on whether
|
|
<I>whence</I>
|
|
|
|
is
|
|
<B>SEEK_SET</B>,
|
|
|
|
<B>SEEK_CUR</B>,
|
|
|
|
or
|
|
<B>SEEK_END</B>,
|
|
|
|
respectively.
|
|
It returns the resulting file position in the argument
|
|
<I>result</I>.
|
|
|
|
<P>
|
|
|
|
This system call exists on various 32-bit platforms to support
|
|
seeking to large file offsets.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
Upon successful completion,
|
|
<B>_llseek</B>()
|
|
|
|
returns 0.
|
|
Otherwise, a value of -1 is returned and
|
|
<I>errno</I>
|
|
|
|
is set to indicate the error.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>EBADF</B>
|
|
|
|
<DD>
|
|
<I>fd</I>
|
|
|
|
is not an open file descriptor.
|
|
<DT id="2"><B>EFAULT</B>
|
|
|
|
<DD>
|
|
Problem with copying results to user space.
|
|
<DT id="3"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
<I>whence</I>
|
|
|
|
is invalid.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
This function is Linux-specific, and should not be used in programs
|
|
intended to be portable.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
Glibc does not provide a wrapper for this system call.
|
|
To invoke it directly, use
|
|
<B><A HREF="/cgi-bin/man/man2html?2+syscall">syscall</A></B>(2).
|
|
|
|
However, you probably want to use the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+lseek">lseek</A></B>(2)
|
|
|
|
wrapper function instead.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+lseek">lseek</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+open">open</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+lseek64">lseek64</A></B>(3)
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="8"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="9"><A HREF="#lbAG">CONFORMING TO</A><DD>
|
|
<DT id="10"><A HREF="#lbAH">NOTES</A><DD>
|
|
<DT id="11"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="12"><A HREF="#lbAJ">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:33 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|