1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH LSEEK64 3 2017-09-15 "Linux" "Linux Programmer's Manual"
27 lseek64 \- reposition 64-bit read/write file offset
29 .BR "#define _LARGEFILE64_SOURCE" " /* See feature_test_macros(7) */"
31 .B #include <sys/types.h>
33 .B #include <unistd.h>
35 .BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence );
39 family of functions reposition the offset of the open file associated
40 with the file descriptor
44 bytes relative to the start, current position, or end of the file,
54 For more details, return value, and errors, see
57 Four interfaces are available:
68 .BI "off_t lseek(int " fd ", off_t " offset ", int " whence );
75 This is a 32-bit signed type on 32-bit architectures, unless one
80 #define _FILE_OFFSET_BITS 64
84 in which case it is a 64-bit signed type.
90 .BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence );
96 uses a 64-bit type even when
99 Its prototype (and the type
101 is available only when one compiles with
105 #define _LARGEFILE64_SOURCE
111 .\" in glibc 2.0.94, not in 2.0.6
112 is available since glibc 2.1, and is defined to be an alias for
119 .BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence );
125 is a 64-bit signed type.
128 .\" in libc 5.0.9, not in 4.7.6
129 is available in glibc and works without special defines.
130 However, the glibc headers do not provide a prototype.
132 the above prototype, or something equivalent, to their own source.
133 When users complained about data loss caused by a miscompilation of
135 glibc 2.1.3 added the link-time warning
138 "the \`llseek\' function may be dangerous; use \`lseek64\' instead."
141 This makes this function unusable if one desires a warning-free
144 On 32-bit architectures,
145 this is the system call that is used to implement all of the above functions.
150 .BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo ,
151 .BI " loff_t *" result ", int " whence );
155 For more details, see
158 64-bit systems don't need an
161 Instead, they have an
163 system call that supports 64-bit file offsets.
165 For an explanation of the terms used in this section, see
171 Interface Attribute Value
174 T} Thread safety MT-Safe