2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" Written 10 June 1995 by Andries Brouwer <aeb@cwi.nl>
|
|
|
|
.\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond <esr@thyrsus.com>
|
|
|
|
.\"
|
2007-05-30 05:36:26 +00:00
|
|
|
.TH LLSEEK 2 2007-06-01 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
_llseek \- reposition read/write file offset
|
|
|
|
.SH SYNOPSIS
|
2006-03-16 00:28:09 +00:00
|
|
|
.nf
|
2004-12-10 09:03:08 +00:00
|
|
|
.B #include <sys/types.h>
|
2007-05-26 15:22:28 +00:00
|
|
|
.B #include <unistd.h>
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
|
|
|
.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,
|
2007-04-12 22:42:49 +00:00
|
|
|
.BI " unsigned long " offset_low ", loff_t *" result ,
|
2006-03-16 00:28:09 +00:00
|
|
|
.BI " unsigned int " whence );
|
|
|
|
.fi
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR _llseek ()
|
2004-12-13 15:39:11 +00:00
|
|
|
function repositions the offset of the open file associated
|
|
|
|
with the file descriptor
|
2004-11-03 13:51:07 +00:00
|
|
|
.I fd
|
|
|
|
to
|
|
|
|
.I (offset_high<<32) | offset_low
|
|
|
|
bytes relative to the beginning of the file, the current position in the file,
|
|
|
|
or the end of the file, depending on whether
|
|
|
|
.I whence
|
|
|
|
is
|
|
|
|
.BR SEEK_SET ,
|
|
|
|
.BR SEEK_CUR ,
|
|
|
|
or
|
|
|
|
.BR SEEK_END ,
|
|
|
|
respectively.
|
|
|
|
It returns the resulting file position in the argument
|
|
|
|
.IR result .
|
|
|
|
.SH "RETURN VALUE"
|
|
|
|
Upon successful completion,
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR _llseek ()
|
2007-06-08 03:17:37 +00:00
|
|
|
returns 0.
|
|
|
|
Otherwise, a value of \-1 is returned and
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
is set to indicate the error.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EBADF
|
|
|
|
.I fd
|
|
|
|
is not an open file descriptor.
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
Problem with copying results to user space.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
.I whence
|
|
|
|
is invalid.
|
|
|
|
.SH "CONFORMING TO"
|
2006-12-17 01:34:44 +00:00
|
|
|
This function is Linux specific, and should not be used in programs
|
2004-11-03 13:51:07 +00:00
|
|
|
intended to be portable.
|
2007-05-26 15:22:28 +00:00
|
|
|
.SH NOTES
|
|
|
|
Glibc does not provide a wrapper for this system call; call it using
|
|
|
|
.BR syscall (2).
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
2004-12-13 15:39:11 +00:00
|
|
|
.BR lseek (2),
|
2007-04-12 22:42:49 +00:00
|
|
|
.BR lseek64 (3)
|