OSDN Git Service

d589b82cbdb7dbc5a982a99b3f7caa287f19df27
[linuxjm/LDP_man-pages.git] / draft / man2 / modify_ldt.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995.
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" USA.
24 .\"
25 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
26 .\"         all rights reserved.
27 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
28 .\" Updated & Modified 2005-02-24, Yuichi SATO <ysato444@yahoo.co.jp>
29 .\" Updated 2007-06-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.57
30 .\"
31 .\"WORD:        ldt                     ldt
32 .\"WORD:        local descriptor table  ローカル・ディスクリプタ・テーブル
33 .\"WORD:        processer               プロセッサ
34 .\"WORD:        entry                   エントリ
35 .\"
36 .TH MODIFY_LDT 2 2007-06-01 "Linux" "Linux Programmer's Manual"
37 .\"O .SH NAME
38 .SH 名前
39 .\"O modify_ldt \- get or set ldt
40 modify_ldt \- ldt を設定または取得する
41 .\"O .SH SYNOPSIS
42 .SH 書式
43 .nf
44 .B #include <sys/types.h>
45 .sp
46 .BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" );
47 .fi
48 .\"O .SH DESCRIPTION
49 .SH 説明
50 .\"O .BR modify_ldt ()
51 .\"O reads or writes the local descriptor table (ldt) for a process.
52 .\"O The ldt is a per-process memory management table used by the i386 processor.
53 .\"O For more information on this table, see an Intel 386 processor handbook.
54 .BR modify_ldt ()
55 はプロセスのローカル・ディスクリプタ・テーブル (local descriptor table; ldt)
56 を読み書きする。
57 ldt は i386 プロセッサで使用されるプロセスごとのメモリ管理テーブルである。
58 このテーブルに関してのより詳しい情報は Intel 386 processor handbook を
59 参照すること。
60 .PP
61 .\"O When
62 .\"O .I func
63 .\"O is 0,
64 .\"O .BR modify_ldt ()
65 .\"O reads the ldt into the memory pointed to by
66 .\"O .IR ptr .
67 .I func
68 が 0 ならば、
69 .BR modify_ldt ()
70 は ldt を
71 .I ptr
72 が指しているメモリに読み込む。
73 .\"O The number of bytes read is the smaller of
74 .\"O .I bytecount
75 .\"O and the actual size of the ldt.
76 読み込むバイト数は実際の ldt のサイズか
77 .I bytecount
78 より小さい方である。
79 .PP
80 .\"O When
81 .\"O .I func
82 .\"O is 1,
83 .\"O .BR modify_ldt ()
84 .\"O modifies one ldt entry.
85 .I func
86 が 1 ならば、
87 .BR modify_ldt ()
88 は ldt エントリの一つを変更する。
89 .\"O .I ptr
90 .\"O points to a
91 .\"O .I user_desc
92 .\"O structure
93 .\"O and
94 .\"O .I bytecount
95 .\"O must equal the size of this structure.
96 .I ptr
97
98 .I user_desc
99 構造体を指し、
100 .I bytecount
101 はこの構造体の大きさに等しくなければならない。
102 .\"
103 .\" FIXME ? say something about func == 2 ans func == 0x11?
104 .\" In Linux 2.4, func == 2 returned "the default ldt"
105 .\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
106 .\" Linux 2.4 and 2.6 implement an operation for func == 0x11
107
108 .\"O The
109 .\"O .I user_desc
110 .\"O structure is defined in \fI<asm/ldt.h>\fP as:
111 .I user_desc
112 構造体は \fI<asm/ldt.h>\fP で以下のように定義されている:
113 .in +4n
114 .nf
115
116 struct user_desc {
117     unsigned int  entry_number;
118     unsigned long base_addr;
119     unsigned int  limit;
120     unsigned int  seg_32bit:1;
121     unsigned int  contents:2;
122     unsigned int  read_exec_only:1;
123     unsigned int  limit_in_pages:1;
124     unsigned int  seg_not_present:1;
125     unsigned int  useable:1;
126 };
127 .fi
128 .in
129 .PP
130 .\"O In Linux 2.4 and earlier, this structure was named
131 .\"O .IR modify_ldt_ldt_s .
132 Linux 2.4 以前では、この構造体は
133 .I modify_ldt_ldt_s
134 という名前であった。
135 .\" .PP
136 .\"O .\" The ldt is specific for the calling process. Any attempts to change
137 .\"O .\" the ldt to include the address space of another process or the kernel
138 .\"O .\" will result in a segmentation violation when trying to access the memory
139 .\"O .\" outside of the process address space. The memory protection is enforced
140 .\"O .\" at the paging layer.
141 .\" ldt は呼び出し元プロセスに固有のものである。
142 .\" 他のプロセスやカーネルのアドレス空間を含むように ldt を変更しようすると、
143 .\" プロセスアドレス空間の外のメモリにアクセスしようとしたときに、
144 .\" セグメンテーション違反 (segmentation violation) になる。
145 .\" メモリ保護はページングレイヤで実施される。
146 .\"O .SH "RETURN VALUE"
147 .SH 返り値
148 .\"O On success,
149 .\"O .BR modify_ldt ()
150 .\"O returns either the actual number of bytes read (for reading)
151 .\"O or 0 (for writing).
152 成功した場合は、
153 .BR modify_ldt ()
154 は (読み込みの場合は) 実際に読み込んだバイト数、
155 または (書き込みの場合は) 0 を返す。
156 .\"O On failure,
157 .\"O .BR modify_ldt ()
158 .\"O returns \-1 and sets
159 .\"O .I errno
160 .\"O to indicate the error.
161 失敗した場合は
162 .BR modify_ldt ()
163 は \-1 を返し、
164 .I errno
165 をエラーを示す値に設定する。
166 .\"O .SH ERRORS
167 .SH エラー
168 .TP
169 .B EFAULT
170 .\"O .I ptr
171 .\"O points outside the address space.
172 .I ptr
173 がアドレス空間の外を指している。
174 .TP
175 .B EINVAL
176 .\"O .I ptr
177 .\"O is 0,
178 .\"O or
179 .\"O .I func
180 .\"O is 1 and
181 .\"O .I bytecount
182 .\"O is not equal to the size of the structure
183 .\"O .IR modify_ldt_ldt_s ,
184 .\"O or
185 .\"O .I func
186 .\"O is 1 and the new ldt entry has invalid values.
187 .I ptr
188 が 0 である、
189 または
190 .I func
191 が 1 で
192 .I bytecount
193
194 .I modify_ldt_ldt_s
195 構造体のサイズと等しくないか、
196 .I func
197 が 1 で新しい ldt エントリが無効な値である。
198 .TP
199 .B ENOSYS
200 .\"O .I func
201 .\"O is neither 0 nor 1.
202 .I func
203 が 0 でも 1 でもない。
204 .\"O .SH "CONFORMING TO"
205 .SH 準拠
206 .\"O This call is Linux-specific and should not be used in programs intended
207 .\"O to be portable.
208 このコールは Linux 特有であり、移植を意図したプログラムでは
209 使用してはいけない。
210 .\"O .SH NOTES
211 .SH 注意
212 .\"O Glibc does not provide a wrapper for this system call; call it using
213 .\"O .BR syscall (2).
214 glibc はこのシステムコールに対するラッパー関数を提供していない。
215 .BR syscall (2)
216 を使って呼び出すこと。
217 .\"O .SH "SEE ALSO"
218 .SH 関連項目
219 .BR vm86 (2)