]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/llseek.2
_syscall.2, clock_getres.2, clone.2, copy_file_range.2, create_module.2, delete_modul...
[thirdparty/man-pages.git] / 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 2016-03-15 "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 .PP
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 .PP
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 description 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 file offset,
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
63 This system call exists on various 32-bit platforms to support
64 seeking to large file offsets.
65 .SH RETURN VALUE
66 Upon successful completion,
67 .BR _llseek ()
68 returns 0.
69 Otherwise, a value of \-1 is returned and
70 .I errno
71 is set to indicate the error.
72 .SH ERRORS
73 .TP
74 .B EBADF
75 .I fd
76 is not an open file descriptor.
77 .TP
78 .B EFAULT
79 Problem with copying results to user space.
80 .TP
81 .B EINVAL
82 .I whence
83 is invalid.
84 .SH CONFORMING TO
85 This function is Linux-specific, and should not be used in programs
86 intended to be portable.
87 .SH NOTES
88 Glibc does not provide a wrapper for this system call.
89 To invoke it directly, use
90 .BR syscall (2).
91 However, you probably want to use the
92 .BR lseek (2)
93 wrapper function instead.
94 .SH SEE ALSO
95 .BR lseek (2),
96 .BR open (2),
97 .BR lseek64 (3)