1LSEEK64(3)                 Linux Programmer's Manual                LSEEK64(3)
2
3
4

NAME

6       lseek64 - reposition 64-bit read/write file offset
7

SYNOPSIS

9       #define _LARGEFILE64_SOURCE
10       #include <sys/types.h>
11       #include <unistd.h>
12
13       off64_t lseek64(int fd, off64_t offset, int whence);
14

DESCRIPTION

16       The lseek(2) family of functions reposition the offset of the open file
17       associated with the file descriptor fd to offset bytes relative to  the
18       start,  current position, or end of the file, when whence has the value
19       SEEK_SET, SEEK_CUR, or SEEK_END, respectively.
20
21       For more details, return value, and errors, see lseek(2).
22
23       Four interfaces are available: lseek(), lseek64(),  llseek(),  and  the
24       raw system call _llseek().
25
26   lseek
27       Prototype:
28
29            off_t lseek(int fd, off_t offset, int whence);
30
31       The  library  routine  lseek()  uses  the type off_t.  This is a 32-bit
32       signed type on 32-bit architectures, unless one compiles with
33
34            #define _FILE_OFFSET_BITS 64
35
36       in which case it is a 64-bit signed type.
37
38
39   lseek64
40       Prototype:
41
42            off64_t lseek64(int fd, off64_t offset, int whence);
43
44       The library routine lseek64() uses a 64-bit type even when off_t  is  a
45       32-bit  type.  Its  prototype  (and the type off64_t) is available only
46       when one compiles with
47
48            #define _LARGEFILE64_SOURCE
49
50       The function lseek64() is available since glibc 2.1, and is defined  to
51       be an alias for llseek().
52
53
54   llseek
55       Prototype:
56
57            loff_t llseek(int fd, loff_t offset, int whence);
58
59       The  type loff_t is a 64-bit signed type.  The library routine llseek()
60       is available in libc5 and glibc and works without special defines.  Its
61       prototype  was  given in <unistd.h> with libc5, but glibc does not pro‐
62       vide a prototype.  This is bad, since  a  prototype  is  needed.  Users
63       should  add  the above prototype, or something equivalent, to their own
64       source.  When users complained about data loss caused by a  miscompila‐
65       tion of e2fsck(8), glibc 2.1.3 added the link-time warning
66
67            "the `llseek´ function may be dangerous; use `lseek64´ instead."
68
69       This  makes this function unusable if one desires a warning-free compi‐
70       lation.
71
72
73   _llseek
74       All the above functions are implemented in terms of this  system  call.
75       The prototype is:
76
77            int _llseek (int fd, off_t offset_hi, off_t offset_lo,
78            loff_t *result, int whence);
79
80       For more details, see llseek(2).
81

SEE ALSO

83       llseek(2), lseek(2), feature_test_macros(7)
84
85
86
87Linux                             2004-12-11                        LSEEK64(3)
Impressum