.\" Copyright 2004 Andries Brouwer . .\" and Copyright (c) 2020 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2005 Yuichi SATO .\" all rights reserved. .\" Translated Sun Jan 30 03:23:04 JST 2005 .\" by Yuichi SATO .\" .TH LSEEK64 3 2020\-11\-01 Linux "Linux Programmer's Manual" .SH 名前 lseek64 \- ファイルの 64 ビットの読み書きオフセットの位置を変える .SH 書式 \fB#define _LARGEFILE64_SOURCE\fP /* feature_test_macros(7) 参照 */ .br \fB#include \fP .br \fB#include \fP .PP \fBoff64_t lseek64(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP .SH 説明 \fBlseek\fP() 関数ファミリーは、ファイルディスクリプター \fIfd\fP に関連するオープンされたファイルのオフセットを、 ファイルの開始位置・現在位置・終端から \fIoffset\fP の位置へ変更する。 これは \fIwhence\fP がそれぞれ \fBSEEK_SET\fP, \fBSEEK_CUR\fP, \fBSEEK_END\fP の場合に対応する。 .PP 更に詳しい説明・返り値・エラーは、 \fBlseek\fP(2) を参照すること。 .PP .\" .\" For some background details, see: .\" https://lore.kernel.org/linux-man/CAKgNAkhNSWR3uYhYYaxx74fZfJ3JrpfAAPVrK0AFk_cAOUsbDg@mail.gmail.com/ .\" 4 つのインターフェースが使用可能である: \fBlseek\fP(), \fBlseek64\fP(), \fBllseek\fP(), \fBllseek\fP() .SS lseek() プロトタイプ: .PP .in +4n .EX \fBoff_t lseek(int \fP\fIfd\fP\fB, off_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP .EE .in .PP The C library's \fBlseek\fP() wrapper function uses the type \fIoff_t\fP. This is a 32\-bit signed type on 32\-bit architectures, unless one compiles with .PP .in +4n .EX #define _FILE_OFFSET_BITS 64 .EE .in .PP を定義してコンパイルした場合は 64 ビット符号付き型である。 .SS lseek64() プロトタイプ: .PP .in +4n .EX \fBoff64_t lseek64(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP .EE .in .PP ライブラリ関数 \fBlseek64\fP() は \fIoff_t\fP が 32 ビット型であっても 64 ビット型を使う。 このプロトタイプ (と型 \fIoff64_t\fP) は、以下の定義をしてコンパイルした場合にのみ使用可能である。 .PP .in +4n .EX #define _LARGEFILE64_SOURCE .EE .in .PP .\" in glibc 2.0.94, not in 2.0.6 .\" 関数 \fBlseek64\fP() は glibc 2.1 以降で使用可能である。 .SS llseek() プロトタイプ: .PP .in +4n .EX \fBloff_t llseek(int \fP\fIfd\fP\fB, loff_t \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP .EE .in .PP 型 \fIloff_t\fP は 64 ビット符号付き型である。 ライブラリ関数 \fBllseek\fP() は glibc で利用可能であり、 特別な定義なしに動作する。 しかしながら、 glibc のヘッダーはプロトタイプを供していない。 ユーザーは上記のプロトタイプまたはそれと同等のものを、 自身のソースに追加しなければならない。 このデータがないことによって \fBe2fsck\fP(8) のコンパイルが失敗するという苦情がユーザーから出たので、 glibc 2.1.3 では以下のようなリンク時の警告が追加された。 .PP .in +4n "the \`llseek\' function may be dangerous; use \`lseek64\' instead." .in .PP これにより、警告なしでコンパイルしたい場合には、この関数を使用不可にできる。 .PP .\" glibc commit 5c5c0dd747070db624c8e2c43691cec854f114ef .\" Since glibc 2.28, this function symbol is no longer available to newly linked applications. .SS _llseek() On 32\-bit architectures, this is the system call that is used (by the C library wrapper functions) to implement all of the above functions. The prototype is: .PP .in +4n .EX \fBint _llseek(int \fP\fIfd\fP\fB, off_t \fP\fIoffset_hi\fP\fB, off_t \fP\fIoffset_lo\fP\fB,\fP \fB loff_t *\fP\fIresult\fP\fB, int \fP\fIwhence\fP\fB);\fP .EE .in .PP 更に詳しい情報は、 \fBllseek\fP(2) を参照すること。 .PP .\" In arch/x86/entry/syscalls/syscall_32.tbl, .\" we see the following line: .\" .\" 140 i386 _llseek sys_llseek .\" .\" This is essentially telling us that 'sys_llseek' (the name generated .\" by SYSCALL_DEFINE5(llseek...)) is exposed to user-space as system call .\" number 140, and that system call number will (IIUC) be exposed in .\" autogenerated headers with the name "__NR__llseek" (i.e., "_llseek"). .\" The "i386" is telling us that this happens in i386 (32-bit Intel). .\" There is nothing equivalent on x86-64, because 64 bit systems don't .\" need an _llseek system call. 64\-bit systems don't need an \fB_llseek\fP() system call. Instead, they have an \fBlseek\fP(2) system call that supports 64\-bit file offsets. .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBlseek64\fP() T} Thread safety MT\-Safe .TE .SH 注意 \fBlseek64\fP() is one of the functions that was specified in the Large File Summit (LFS) specification that was completed in 1996. The purpose of the specification was to provide transitional support that allowed applications on 32\-bit systems to access files whose size exceeds that which can be represented with a 32\-bit \fIoff_t\fP type. As noted above, this symbol is exposed by header files if the \fB_LARGEFILE64_SOURCE\fP feature test macro is defined. ALternatively, on a 32\-bit system, the symbol \fIlseek\fP is aliased to \fIlseek64\fP if the macro \fB_FILE_OFFSET_BITS\fP is defined with the value 64. .SH 関連項目 \fBllseek\fP(2), \fBlseek\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。