modify_ldtのヘルプ・マニュアル
日本語 英語
modify_ldt --help
man modify_ldt
MODIFY_LDT(2) Linux Programmer’s Manual MODIFY_LDT(2)
名前
modify_ldt - ldt を設定または取得する
書式
#include
int modify_ldt(int func, void *ptr, unsigned long bytecount);
説明
modify_ldt() は プ ロ セスのローカル・ディスクリプタ・テーブル (local
descriptor table; ldt) を読み書きする。 ldt は i386 プロセッサで使用 さ
れ るプロセスごとのメモリ管理テーブルである。このテーブルに関してのより
詳しい情報は Intel 386 processor handbook を参照すること。
func が 0 ならば、 modify_ldt() は ldt を ptr が指しているメモリに読 み
込 む。読み込むバイト数は実際の ldt のサイズか bytecount より小さい方で
ある。
func が 1 ならば、 modify_ldt() は ldt エントリの一つを変更する 。 ptr
は user_desc 構造体を指し、 bytecount はこの構造体の大きさに等しくなけ
ればならない。
user_desc 構造体は で以下のように定義されている:
struct user_desc {
unsigned int entry_number;
unsigned long base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;
unsigned int read_exec_only:1;
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
unsigned int useable:1;
};
Linux 2.4 以前では、この構造体は modify_ldt_ldt_s という名前であった。
返り値
成功した場合は、 modify_ldt() は (読み込みの場合は) 実際に読み込んだ バ
イト数、または (書き込みの場合は) 0 を返す。失敗した場合は modify_ldt()
は -1 を返し、 errno をエラーを示す値に設定する。
エラー
EFAULT ptr がアドレス空間の外を指している。
EINVAL ptr が 0 である、または func が 1 で bytecount が mod-
ify_ldt_ldt_s 構造体のサイズと等しくないか、 func が 1 で新しい
ldt エントリが無効な値である。
ENOSYS func が 0 でも 1 でもない。
準拠
このコールは Linux 特有であり、移植を意図したプログラムでは使用してはい
けない。
注意
glibc は こ の シ ス テムコールに対するラッパー関数を提供していない。
syscall(2) を使って呼び出すこと。
関連項目
vm86(2)
Linux 2007-06-01 MODIFY_LDT(2)
MODIFY_LDT(2) Linux Programmer’s Manual MODIFY_LDT(2)
NAME
modify_ldt - get or set ldt
SYNOPSIS
#include
int modify_ldt(int func, void *ptr, unsigned long bytecount);
DESCRIPTION
modify_ldt() reads or writes the local descriptor table (ldt) for a
process. The ldt is a per-process memory management table used by the
i386 processor. For more information on this table, see an Intel 386
processor handbook.
When func is 0, modify_ldt() reads the ldt into the memory pointed to
by ptr. The number of bytes read is the smaller of bytecount and the
actual size of the ldt.
When func is 1, modify_ldt() modifies one ldt entry. ptr points to a
user_desc structure and bytecount must equal the size of this struc-
ture.
The user_desc structure is defined in as:
struct user_desc {
unsigned int entry_number;
unsigned long base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;
unsigned int read_exec_only:1;
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
unsigned int useable:1;
};
In Linux 2.4 and earlier, this structure was named modify_ldt_ldt_s.
RETURN VALUE
On success, modify_ldt() returns either the actual number of bytes read
(for reading) or 0 (for writing). On failure, modify_ldt() returns -1
and sets errno to indicate the error.
ERRORS
EFAULT ptr points outside the address space.
EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of
the structure modify_ldt_ldt_s, or func is 1 and the new ldt
entry has invalid values.
ENOSYS func is neither 0 nor 1.
CONFORMING TO
This call is Linux-specific and should not be used in programs intended
to be portable.
NOTES
Glibc does not provide a wrapper for this system call; call it using
syscall(2).
SEE ALSO
vm86(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2007-06-01 MODIFY_LDT(2)