OSDN Git Service

LDP: Address fuzzy changes (stdio)
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / lseek64.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright (c) 2020 Michael Kerrisk <mtk.manpages@gmail.com>
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 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
33 .\"         all rights reserved.
34 .\" Translated Sun Jan 30 03:23:04 JST 2005
35 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
36 .\"
37 .TH LSEEK64 3 2020\-11\-01 Linux "Linux Programmer's Manual"
38 .SH 名前
39 lseek64 \- ファイルの 64 ビットの読み書きオフセットの位置を変える
40 .SH 書式
41 \fB#define _LARGEFILE64_SOURCE\fP /* feature_test_macros(7) 参照 */
42 .br
43 \fB#include <sys/types.h>\fP
44 .br
45 \fB#include <unistd.h>\fP
46 .PP
47 \fBoff64_t lseek64(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
48 .SH 説明
49 \fBlseek\fP() 関数ファミリーは、ファイルディスクリプター \fIfd\fP に関連するオープンされたファイルのオフセットを、
50 ファイルの開始位置・現在位置・終端から \fIoffset\fP の位置へ変更する。 これは \fIwhence\fP がそれぞれ \fBSEEK_SET\fP,
51 \fBSEEK_CUR\fP, \fBSEEK_END\fP の場合に対応する。
52 .PP
53 更に詳しい説明・返り値・エラーは、 \fBlseek\fP(2)  を参照すること。
54 .PP
55 .\"
56 .\" For some background details, see:
57 .\" https://lore.kernel.org/linux-man/CAKgNAkhNSWR3uYhYYaxx74fZfJ3JrpfAAPVrK0AFk_cAOUsbDg@mail.gmail.com/
58 .\"
59 4 つのインターフェースが使用可能である: \fBlseek\fP(), \fBlseek64\fP(), \fBllseek\fP(), \fBllseek\fP()
60 .SS lseek()
61 プロトタイプ:
62 .PP
63 .in +4n
64 .EX
65 \fBoff_t lseek(int \fP\fIfd\fP\fB, off_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
66 .EE
67 .in
68 .PP
69 The C library's \fBlseek\fP()  wrapper function uses the type \fIoff_t\fP.  This
70 is a 32\-bit signed type on 32\-bit architectures, unless one compiles with
71 .PP
72 .in +4n
73 .EX
74 #define _FILE_OFFSET_BITS 64
75 .EE
76 .in
77 .PP
78 を定義してコンパイルした場合は 64 ビット符号付き型である。
79 .SS lseek64()
80 プロトタイプ:
81 .PP
82 .in +4n
83 .EX
84 \fBoff64_t lseek64(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
85 .EE
86 .in
87 .PP
88 ライブラリ関数 \fBlseek64\fP()  は \fIoff_t\fP が 32 ビット型であっても 64 ビット型を使う。 このプロトタイプ (と型
89 \fIoff64_t\fP)  は、以下の定義をしてコンパイルした場合にのみ使用可能である。
90 .PP
91 .in +4n
92 .EX
93 #define _LARGEFILE64_SOURCE
94 .EE
95 .in
96 .PP
97 .\" in glibc 2.0.94, not in 2.0.6
98 .\"
99 関数 \fBlseek64\fP()  は glibc 2.1 以降で使用可能である。
100 .SS llseek()
101 プロトタイプ:
102 .PP
103 .in +4n
104 .EX
105 \fBloff_t llseek(int \fP\fIfd\fP\fB, loff_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
106 .EE
107 .in
108 .PP
109 型 \fIloff_t\fP は 64 ビット符号付き型である。 ライブラリ関数 \fBllseek\fP() は glibc で利用可能であり、
110 特別な定義なしに動作する。 しかしながら、 glibc のヘッダーはプロトタイプを供していない。 ユーザーは上記のプロトタイプまたはそれと同等のものを、
111 自身のソースに追加しなければならない。 このデータがないことによって \fBe2fsck\fP(8)
112 のコンパイルが失敗するという苦情がユーザーから出たので、 glibc 2.1.3 では以下のようなリンク時の警告が追加された。
113 .PP
114 .in +4n
115 "the \`llseek\' function may be dangerous; use \`lseek64\' instead."
116 .in
117 .PP
118 これにより、警告なしでコンパイルしたい場合には、この関数を使用不可にできる。
119 .PP
120 .\" glibc commit 5c5c0dd747070db624c8e2c43691cec854f114ef
121 .\"
122 Since glibc 2.28, this function symbol is no longer available to newly
123 linked applications.
124 .SS _llseek()
125 On 32\-bit architectures, this is the system call that is used (by the C
126 library wrapper functions)  to implement all of the above functions.  The
127 prototype is:
128 .PP
129 .in +4n
130 .EX
131 \fBint _llseek(int \fP\fIfd\fP\fB, off_t \fP\fIoffset_hi\fP\fB, off_t \fP\fIoffset_lo\fP\fB,\fP
132 \fB            loff_t *\fP\fIresult\fP\fB, int \fP\fIwhence\fP\fB);\fP
133 .EE
134 .in
135 .PP
136 更に詳しい情報は、 \fBllseek\fP(2)  を参照すること。
137 .PP
138 .\" In arch/x86/entry/syscalls/syscall_32.tbl,
139 .\" we see the following line:
140 .\"
141 .\"    140     i386    _llseek                 sys_llseek
142 .\"
143 .\" This is essentially telling us that 'sys_llseek' (the name generated
144 .\" by SYSCALL_DEFINE5(llseek...)) is exposed to user-space as system call
145 .\" number 140, and that system call number will (IIUC) be exposed in
146 .\" autogenerated headers with the name "__NR__llseek" (i.e., "_llseek").
147 .\" The "i386" is telling us that this happens in i386 (32-bit Intel).
148 .\" There is nothing equivalent on x86-64, because 64 bit systems don't
149 .\" need an _llseek system call.
150 64\-bit systems don't need an \fB_llseek\fP()  system call.  Instead, they have
151 an \fBlseek\fP(2)  system call that supports 64\-bit file offsets.
152 .SH 属性
153 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
154 .TS
155 allbox;
156 lb lb lb
157 l l l.
158 インターフェース        属性  値
159 T{
160 \fBlseek64\fP()
161 T}      Thread safety   MT\-Safe
162 .TE
163 .SH 注意
164 \fBlseek64\fP()  is one of the functions that was specified in the Large File
165 Summit (LFS)  specification that was completed in 1996.  The purpose of the
166 specification was to provide transitional support that allowed applications
167 on 32\-bit systems to access files whose size exceeds that which can be
168 represented with a 32\-bit \fIoff_t\fP type.  As noted above, this symbol is
169 exposed by header files if the \fB_LARGEFILE64_SOURCE\fP feature test macro is
170 defined.  ALternatively, on a 32\-bit system, the symbol \fIlseek\fP is aliased
171 to \fIlseek64\fP if the macro \fB_FILE_OFFSET_BITS\fP is defined with the value
172 64.
173 .SH 関連項目
174 \fBllseek\fP(2), \fBlseek\fP(2)
175 .SH この文書について
176 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
177 \%https://www.kernel.org/doc/man\-pages/ に書かれている。