Man page - lseek64(3)

Packages contains this manual

Available languages:

en fr ja ro

Manual

LSEEK64

名 前
書 式
説 明
lseek()
lseek64()
llseek()
_llseek()
属 性
注 意
関 連 項 目
こ の 文 書 に つ い て

名 前

lseek64 - フ ァ イ ル の 64 ビ ッ ト の 読 み 書 き オ フ セ ッ ト の 位 置 を 変 え る

書 式

#define _LARGEFILE64_SOURCE /* feature_test_macros(7) 参 照 */
#include <sys/types.h>
#include <unistd.h>

off64_t lseek64(int fd , off64_t offset , int whence );

説 明

lseek () 関 数 フ ァ ミ リ ー は 、 フ ァ イ ル デ ィ ス ク リ プ タ ー fd に 関 連 す る オ ー プ ン さ れ た フ ァ イ ル の オ フ セ ッ ト を 、 フ ァ イ ル の 開 始 位 置 ・ 現 在 位 置 ・ 終 端 か ら offset の 位 置 へ 変 更 す る 。 こ れ は whence が そ れ ぞ れ SEEK_SET , SEEK_CUR , SEEK_END の 場 合 に 対 応 す る 。

更 に 詳 し い 説 明 ・ 返 り 値 ・ エ ラ ー は 、 lseek (2) を 参 照 す る こ と 。

4 つ の イ ン タ ー フ ェ ー ス が 使 用 可 能 で あ る : lseek (), lseek64 (), llseek (), llseek ()

lseek()

プ ロ ト タ イ プ :

off_t lseek(int fd , off_t offset , int whence );

The C library’s lseek () wrapper function uses the type off_t . This is a 32-bit signed type on 32-bit architectures, unless one compiles with

#define _FILE_OFFSET_BITS 64

を 定 義 し て コ ン パ イ ル し た 場 合 は 64 ビ ッ ト 符 号 付 き 型 で あ る 。

lseek64()

プ ロ ト タ イ プ :

off64_t lseek64(int fd , off64_t offset , int whence );

ラ イ ブ ラ リ 関 数 lseek64 () は off_t が 32 ビ ッ ト 型 で あ っ て も 64 ビ ッ ト 型 を 使 う 。 こ の プ ロ ト タ イ プ (と 型 off64_t ) は 、 以 下 の 定 義 を し て コ ン パ イ ル し た 場 合 に の み 使 用 可 能 で あ る 。

#define _LARGEFILE64_SOURCE

関 数 lseek64 () は glibc 2.1 以 降 で 使 用 可 能 で あ る 。

llseek()

プ ロ ト タ イ プ :

loff_t llseek(int fd , loff_t offset , int whence );

loff_t は 64 ビ ッ ト 符 号 付 き 型 で あ る 。 ラ イ ブ ラ リ 関 数 llseek () は glibc で 利 用 可 能 で あ り 、 特 別 な 定 義 な し に 動 作 す る 。 し か し な が ら 、 glibc の ヘ ッ ダ ー は プ ロ ト タ イ プ を 供 し て い な い 。 ユ ー ザ ー は 上 記 の プ ロ ト タ イ プ ま た は そ れ と 同 等 の も の を 、 自 身 の ソ ー ス に 追 加 し な け れ ば な ら な い 。 こ の デ ー タ が な い こ と に よ っ て e2fsck (8) の コ ン パ イ ル が 失 敗 す る と い う 苦 情 が ユ ー ザ ー か ら 出 た の で 、 glibc 2.1.3 で は 以 下 の よ う な リ ン ク 時 の 警 告 が 追 加 さ れ た 。

"the `llseek´ function may be dangerous; use `lseek64´ instead."

こ れ に よ り 、 警 告 な し で コ ン パ イ ル し た い 場 合 に は 、 こ の 関 数 を 使 用 不 可 に で き る 。

Since glibc 2.28, this function symbol is no longer available to newly linked applications.

_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:

int _llseek(int fd , off_t offset_hi , off_t offset_lo ,
loff_t *
result , int whence );

更 に 詳 し い 情 報 は 、 llseek (2) を 参 照 す る こ と 。

64-bit systems don’t need an _llseek () system call. Instead, they have an lseek (2) system call that supports 64-bit file offsets.

属 性

こ の 節 で 使 用 さ れ て い る 用 語 の 説 明 に つ い て は 、 attributes (7) を 参 照 。

Image grohtml-18241-1.png

注 意

lseek64 () 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 off_t type. As noted above, this symbol is exposed by header files if the _LARGEFILE64_SOURCE feature test macro is defined. ALternatively, on a 32-bit system, the symbol lseek is aliased to lseek64 if the macro _FILE_OFFSET_BITS is defined with the value 64.

関 連 項 目

llseek (2), lseek (2)

こ の 文 書 に つ い て

こ の man ペ ー ジ は Linux man-pages プ ロ ジ ェ ク ト の リ リ ー ス 5.10 の 一 部 で あ る 。 プ ロ ジ ェ ク ト の 説 明 と バ グ 報 告 に 関 す る 情 報 は https://www.kernel.org/doc/man-pages/ に 書 か れ て い る 。