OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / lseek64.3
1 .\" Copyright 2004 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 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sun Jan 30 03:23:04 JST 2005
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\"
28 .TH LSEEK64 3 2004-12-11 "Linux" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 .\"O lseek64 \- reposition 64-bit read/write file offset
32 lseek64 \- ¥Õ¥¡¥¤¥ë¤Î 64 ¥Ó¥Ã¥È¤ÎÆɤ߽ñ¤­¥ª¥Õ¥»¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ë
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .\"O .BR "#define _LARGEFILE64_SOURCE" "     /* See feature_test_macros(7) */"
36 .BR "#define _LARGEFILE64_SOURCE" "     /* feature_test_macros(7) »²¾È */"
37 .br
38 .B #include <sys/types.h>
39 .br
40 .B #include <unistd.h>
41 .sp
42 .BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence );
43 .\"O .SH DESCRIPTION
44 .SH ÀâÌÀ
45 .\"O The
46 .\"O .BR lseek (2)
47 .\"O family of functions reposition the offset of the open file associated
48 .\"O with the file descriptor
49 .\"O .I fd
50 .\"O to
51 .\"O .I offset
52 .\"O bytes relative to the start, current position, or end of the file,
53 .\"O when
54 .\"O .I whence
55 .\"O has the value
56 .\"O .BR SEEK_SET ,
57 .\"O .BR SEEK_CUR ,
58 .\"O or
59 .\"O .BR SEEK_END ,
60 .\"O respectively.
61 .BR lseek (2)
62 ´Ø¿ô¥Õ¥¡¥ß¥ê¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
63 .I fd
64 ¤Ë´ØÏ¢¤¹¤ë¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥ª¥Õ¥»¥Ã¥È¤ò¡¢
65 ¥Õ¥¡¥¤¥ë¤Î³«»Ï°ÌÃÖ¡¦¸½ºß°ÌÃÖ¡¦½ªÃ¼¤«¤é
66 .I offset
67 ¤Î°ÌÃÖ¤ØÊѹ¹¤¹¤ë¡£
68 ¤³¤ì¤Ï
69 .I whence
70 ¤¬¤½¤ì¤¾¤ì
71 .BR SEEK_SET ,
72 .BR SEEK_CUR ,
73 .B SEEK_END
74 ¤Î¾ì¹ç¤ËÂбþ¤¹¤ë¡£
75 .LP
76 .\"O For more details, return value, and errors, see
77 .\"O .BR lseek (2).
78 ¹¹¤Ë¾Ü¤·¤¤ÀâÌÀ¡¦ÊÖ¤êÃÍ¡¦¥¨¥é¡¼¤Ï¡¢
79 .BR lseek (2)
80 ¤ò»²¾È¤¹¤ë¤³¤È¡£
81 .PP
82 .\"O Four interfaces are available:
83 .\"O .BR lseek (2),
84 .\"O .BR lseek64 (),
85 .\"O .BR llseek (2),
86 .\"O and the raw system call
87 .\"O .BR _llseek (2).
88 4 ¤Ä¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬»ÈÍѲÄǽ¤Ç¤¢¤ë:
89 .BR lseek (2),
90 .BR lseek64 (),
91 .BR llseek (2)
92 ¤È¸µ¤È¤Ê¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë
93 .BR _llseek (2)
94 ¤Ç¤¢¤ë¡£
95 .SS lseek
96 .\"O Prototype:
97 ¥×¥í¥È¥¿¥¤¥×:
98 .nf
99 .sp
100 .in +4n
101 .BI "off_t lseek(int " fd ", off_t " offset ", int " whence );
102 .in
103 .fi
104 .sp
105 .\"O .BR lseek (2)
106 .\"O uses the type
107 .\"O .IR off_t .
108 .BR lseek (2)
109 ¤Ï·¿
110 .I off_t
111 ¤ò»È¤¦¡£
112 .\"O This is a 32-bit signed type on 32-bit architectures, unless one
113 .\"O compiles with
114 ¤³¤ì¤Ï 32 ¥Ó¥Ã¥È¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Ç¤Ï 32 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£
115 ¤¿¤À¤·¡¢
116 .nf
117 .sp
118 .in +4n
119 #define _FILE_OFFSET_BITS 64
120 .in
121 .sp
122 .fi
123 .\"O in which case it is a 64-bit signed type.
124 ¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£
125 .SS lseek64
126 .\"O Prototype:
127 ¥×¥í¥È¥¿¥¤¥×:
128 .nf
129 .sp
130 .in +4n
131 .BI "off64_t lseek64(int " fd ", off64_t " offset ", int " whence );
132 .in
133 .fi
134 .sp
135 .\"O The library routine
136 .\"O .BR lseek64 ()
137 .\"O uses a 64-bit type even when
138 .\"O .I off_t
139 .\"O is a 32-bit type.
140 .\"O Its prototype (and the type
141 .\"O .IR off64_t )
142 .\"O is available only when one compiles with
143 ¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó
144 .BR lseek64 ()
145 ¤Ï
146 .I off_t
147 ¤¬ 32 ¥Ó¥Ã¥È·¿¤Ç¤¢¤Ã¤Æ¤â 64 ¥Ó¥Ã¥È·¿¤ò»È¤¦¡£
148 ¤³¤Î¥×¥í¥È¥¿¥¤¥× (¤È·¿
149 .IR off64_t )
150 ¤Ï¡¢°Ê²¼¤ÎÄêµÁ¤ò¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
151 .nf
152 .sp
153 .in +4n
154 #define _LARGEFILE64_SOURCE
155 .in
156 .sp
157 .fi
158 .\"O The function
159 .\"O .BR lseek64 ()
160 .\"O .\" in glibc 2.0.94, not in 2.0.6
161 .\"O is available since glibc 2.1, and is defined to be an alias for
162 .\"O .BR llseek ().
163 ´Ø¿ô
164 .BR lseek64 ()
165 .\" glibc 2.0.94 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 2.0.6 ¤Ë¤Ï¸ºß¤·¤Ê¤¤
166 ¤Ï glibc 2.1 °Ê¹ß¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢
167 .BR llseek ()
168 ¤Î¥¨¥¤¥ê¥¢¥¹¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
169 .SS llseek
170 .\"O Prototype:
171 ¥×¥í¥È¥¿¥¤¥×:
172 .nf
173 .sp
174 .in +4n
175 .BI "loff_t llseek(int " fd ", loff_t " offset ", int " whence );
176 .in
177 .fi
178 .sp
179 .\"O The type
180 .\"O .I loff_t
181 .\"O is a 64-bit signed type.
182 ·¿
183 .I loff_t
184 ¤Ï 64 ¥Ó¥Ã¥ÈÉä¹æÉÕ¤­·¿¤Ç¤¢¤ë¡£
185 .\"O The library routine
186 .\"O .BR llseek ()
187 .\"O .\" in libc 5.0.9, not in 4.7.6
188 .\"O is available in libc5 and glibc and works without special defines.
189 ¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó
190 .BR llseek ()
191 .\" libc 5.0.9 ¤Ë¤Ï¸ºß¤¹¤ë¤¬ 4.7.6 ¤Ï¸ºß¤·¤Ê¤¤
192 ¤Ï libc5 ¤È glibc ¤Ç»ÈÍѲÄǽ¤Ç¤¢¤ê¡¢ÆÃÊ̤ÊÄêµÁ¤Ê¤·¤ËÆ°ºî¤¹¤ë¡£
193 .\"O Its prototype was given in
194 .\"O .I <unistd.h>
195 .\"O with libc5, but glibc does not provide a prototype.
196 ¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï¡¢libc5 ¤Ç¤Ï
197 .I <unistd.h>
198 ¤ÇÍ¿¤¨¤é¤ì¤ë¤¬¡¢glibc ¤Ï¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤·¤Ê¤¤¡£
199 .\"O This is bad, since a prototype is needed.
200 .\"O Users should add
201 .\"O the above prototype, or something equivalent, to their own source.
202 ¤³¤ì¤Ï¥×¥í¥È¥¿¥¤¥×¤¬É¬Íפˤʤë¤Î¤ÇÎɤ¯¤Ê¤¤¡£
203 ¥æ¡¼¥¶¤Ï¾åµ­¤Î¥×¥í¥È¥¿¥¤¥×¤Þ¤¿¤Ï¤½¤ì¤ÈƱÅù¤Î¤â¤Î¤ò¡¢
204 ¼«¿È¤Î¥½¡¼¥¹¤ËÄɲ䷤ʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
205 .\"O When users complained about data loss caused by a miscompilation of
206 .\"O .BR e2fsck (8),
207 .\"O glibc 2.1.3 added the link-time warning
208 ¤³¤Î¥Ç¡¼¥¿¤¬¤Ê¤¤¤³¤È¤Ë¤è¤Ã¤Æ
209 .BR e2fsck (8)
210 ¤Î¥³¥ó¥Ñ¥¤¥ë¤¬¼ºÇÔ¤¹¤ë¤È¤¤¤¦¶ì¾ð¤¬¥æ¡¼¥¶¤«¤é½Ð¤¿¤Î¤Ç¡¢
211 glibc 2.1.3 ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥ê¥ó¥¯»þ¤Î·Ù¹ð¤¬Äɲ䵤줿¡£
212 .sp
213 .in +4n
214 "the \`llseek\' function may be dangerous; use \`lseek64\' instead."
215 .in
216 .sp
217 .\"O This makes this function unusable if one desires a warning-free
218 .\"O compilation.
219 ¤³¤ì¤Ë¤è¤ê¡¢·Ù¹ð¤Ê¤·¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤ò»ÈÍÑÉԲĤˤǤ­¤ë¡£
220 .SS _llseek
221 .\"O All the above functions are implemented in terms of this system call.
222 .\"O The prototype is:
223 ¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë´ð¤Å¤¤¤Æ¼ÂÁõ¤µ¤ì¤ë¡£
224 ¥×¥í¥È¥¿¥¤¥×¤Ï°Ê²¼¤ÎÄ̤ê:
225 .nf
226 .sp
227 .in +4n
228 .BI "int _llseek(int " fd ", off_t " offset_hi ", off_t " offset_lo ,
229 .BI "            loff_t *" result ", int " whence );
230 .in
231 .fi
232 .sp
233 .\"O For more details, see
234 .\"O .BR llseek (2).
235 ¹¹¤Ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢
236 .BR llseek (2)
237 ¤ò»²¾È¤¹¤ë¤³¤È¡£
238 .\"O .SH "SEE ALSO"
239 .SH ´ØÏ¢¹àÌÜ
240 .BR llseek (2),
241 .BR lseek (2)