OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / llseek.2
1 .\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
2 .\" Written 10 June 1995 by Andries Brouwer <aeb@cwi.nl>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond <esr@thyrsus.com>
27 .\"
28 .TH LLSEEK 2 2012-07-13 "Linux" "Linux Programmer's Manual"
29 .SH NAME
30 _llseek \- reposition read/write file offset
31 .SH SYNOPSIS
32 .nf
33 .B #include <sys/types.h>
34 .B #include <unistd.h>
35 .sp
36 .BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,
37 .BI "            unsigned long " offset_low ", loff_t *" result ,
38 .BI "            unsigned int " whence );
39 .fi
40
41 .IR Note :
42 There is no glibc wrapper for this system call; see NOTES.
43 .SH DESCRIPTION
44 The
45 .BR _llseek ()
46 function repositions the offset of the open file associated
47 with the file descriptor
48 .I fd
49 to
50 .I (offset_high<<32) | offset_low
51 bytes relative to the beginning of the file, the current position in the file,
52 or the end of the file, depending on whether
53 .I whence
54 is
55 .BR SEEK_SET ,
56 .BR SEEK_CUR ,
57 or
58 .BR SEEK_END ,
59 respectively.
60 It returns the resulting file position in the argument
61 .IR result .
62 .SH RETURN VALUE
63 Upon successful completion,
64 .BR _llseek ()
65 returns 0.
66 Otherwise, a value of \-1 is returned and
67 .I errno
68 is set to indicate the error.
69 .SH ERRORS
70 .TP
71 .B EBADF
72 .I fd
73 is not an open file descriptor.
74 .TP
75 .B EFAULT
76 Problem with copying results to user space.
77 .TP
78 .B EINVAL
79 .I whence
80 is invalid.
81 .SH CONFORMING TO
82 This function is Linux-specific, and should not be used in programs
83 intended to be portable.
84 .SH NOTES
85 Glibc does not provide a wrapper for this system call; call it using
86 .BR syscall (2).
87 .SH SEE ALSO
88 .BR lseek (2),
89 .BR lseek64 (3)
90 .SH COLOPHON
91 This page is part of release 3.79 of the Linux
92 .I man-pages
93 project.
94 A description of the project,
95 information about reporting bugs,
96 and the latest version of this page,
97 can be found at
98 \%http://www.kernel.org/doc/man\-pages/.