OSDN Git Service

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