OSDN Git Service

0f21b82fdee7aaa4c1e1a5052033561d620ca9e2
[linuxjm/LDP_man-pages.git] / draft / man2 / arch_prctl.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 2003 Andi Kleen
4 .\"
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 .\"
25 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated 2004-06-08, Yuichi SATO <ysato444@yahoo.co.jp>
28 .\" Updated 2005-11-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
30 .\"
31 .TH ARCH_PRCTL 2 2007-12-26 "Linux" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH 名前
34 .\"O arch_prctl \- set architecture-specific thread state
35 arch_prctl \- アーキテクチャ固有のスレッド状態を設定する
36 .\"O .SH SYNOPSIS
37 .SH 書式
38 .nf
39 .B #include <asm/prctl.h>
40 .br
41 .B #include <sys/prctl.h>
42 .sp
43 .BI "int arch_prctl(int " code ", unsigned long *" addr );
44 .fi
45 .\"O .SH DESCRIPTION
46 .SH 説明
47 .\"O The
48 .\"O .BR arch_prctl ()
49 .\"O function sets architecture-specific process or thread state.
50 .BR arch_prctl ()
51 関数はアーキテクチャ固有のプロセス状態またはスレッド状態を設定する。
52 .\"O .I code
53 .\"O selects a subfunction
54 .\"O and passes argument
55 .\"O .I addr
56 .\"O to it;
57 .\"O .I addr
58 .\"O is interpreted as either an
59 .\"O .I "unsigned long"
60 .\"O for the "set" operations, or as an
61 .\"O .IR "unsigned long *" ,
62 .\"O for the "get" operations.
63 .I code
64 は副機能を選択し、引き数
65 .I addr
66 を副機能に渡す。
67 .I addr
68 は、"set" 操作では
69 .I "unsigned long"
70 として、"get" 操作では
71 .I "unsigned long *"
72 として解釈される。
73 .LP
74 .\"O Sub functions for x86-64 are:
75 x86-64 の副機能は以下の通り:
76 .TP
77 .B ARCH_SET_FS
78 .\"O Set the 64-bit base for the
79 .\"O .I FS
80 .\"O register to
81 .\"O .IR addr .
82 .I FS
83 レジスタの 64 ビットベースを
84 .I addr
85 に設定する。
86 .TP
87 .B ARCH_GET_FS
88 .\"O Return the 64-bit base value for the
89 .\"O .I FS
90 .\"O register of the current thread in the
91 .\"O .I unsigned long
92 .\"O pointed to by
93 .\"O .IR addr .
94 現在のスレッドの
95 .I FS
96 レジスタの 64 ビットベース値を、
97 .I addr
98 が指す
99 .I unsigned long
100 の領域に格納する。
101 .TP
102 .B ARCH_SET_GS
103 .\"O Set the 64-bit base for the
104 .\"O .I GS
105 .\"O register to
106 .\"O .IR addr .
107 .I GS
108 レジスタの 64 ビットベースを
109 .I addr
110 に設定する。
111 .TP
112 .B ARCH_GET_GS
113 .\"O Return the 64-bit base value for the
114 .\"O .I GS
115 .\"O register of the current thread in the
116 .\"O .I unsigned long
117 .\"O pointed to by
118 .\"O .IR addr .
119 現在のスレッドの
120 .I GS
121 レジスタの 64 ビットベース値を、
122 .I addr
123 が指す
124 .I unsigned long
125 の領域に格納する。
126 .\"O .SH RETURN VALUE
127 .SH 返り値
128 .\"O On success,
129 .\"O .BR arch_prctl ()
130 .\"O returns 0; on error, \-1 is returned, and
131 .\"O .I errno
132 .\"O is set to indicate the error.
133 成功すると、
134 .BR arch_prctl ()
135 は 0 を返す。エラーの場合、\-1 を返し、
136 .I errno
137 をエラーを示す値に設定する。
138 .\"O .SH ERRORS
139 .SH エラー
140 .TP
141 .B EFAULT
142 .\"O .I addr
143 .\"O points to an unmapped address or is outside the process address space.
144 .I addr
145 がアンマップされたアドレスを指しているか、プロセスのアドレス空間の外にある。
146 .TP
147 .B EINVAL
148 .\"O .I code
149 .\"O is not a valid subcommand.
150 .I code
151 が有効なサブコマンドでない。
152 .TP
153 .B EPERM
154 .\"O .I addr
155 .\"O is outside the process address space.
156 .I addr
157 がプロセスのアドレス空間の外にある。
158 .\"O .\" .SH AUTHOR
159 .\" .SH 著者
160 .\"O .\" Man page written by Andi Kleen.
161 .\" この man ページは Andi Kleen によって書かれた。
162 .\"O .SH "CONFORMING TO"
163 .SH 準拠
164 .\"O .BR arch_prctl ()
165 .\"O is a Linux/x86-64 extension and should not be used in programs intended
166 .\"O to be portable.
167 .BR arch_prctl ()
168 は Linux/x86-64 拡張であり、移植性を意図したプログラムでは使うべきでない。
169 .\"O .SH NOTES
170 .SH 注意
171 .\"O .BR arch_prctl ()
172 .\"O is only supported on Linux/x86-64 for 64-bit programs currently.
173 .BR arch_prctl ()
174 は現在のところ Linux/x86-64 上の 64 ビットプログラムでのみサポートされている。
175
176 .\"O The 64-bit base changes when a new 32-bit segment selector is loaded.
177 新しい 32 ビットセグメントセレクタがロードされた場合、
178 64 ビットベースは変更される。
179
180 .\"O .B ARCH_SET_GS
181 .\"O is disabled in some kernels.
182 .B ARCH_SET_GS
183 が無効にされているカーネルもある。
184
185 .\"O Context switches for 64-bit segment bases are rather expensive.
186 .\"O It may be a faster alternative to set a 32-bit base using a
187 .\"O segment selector by setting up an LDT with
188 .\"O .BR modify_ldt (2)
189 .\"O or using the
190 .\"O .BR set_thread_area (2)
191 .\"O system call in kernel 2.5 or later.
192 64 ビットセグメントベースのコンテキストスイッチは、やや高価である。
193 LDT を
194 .BR modify_ldt (2)
195 で設定してセグメントセレクタを使うか、
196 (カーネル 2.5 以降の)
197 .BR set_thread_area (2)
198 システムコールを使うことにより、
199 32 ビットベースを設定するという高速な代替手段もある。
200 .\"O .BR arch_prctl ()
201 .\"O is only needed when you want to set bases that are larger than 4GB.
202 4GB より大きなベースを設定したい場合にのみ、
203 .BR arch_prctl ()
204 が必要である。
205 .\"O Memory in the first 2GB of address space can be allocated by using
206 .\"O .BR mmap (2)
207 .\"O with the
208 .\"O .B MAP_32BIT
209 .\"O flag.
210 アドレス空間の最初の 2GB にあるメモリは、
211 .BR mmap (2)
212
213 .B MAP_32BIT
214 フラグを指定して割り当てることができる。
215
216 .\"O As of version 2.7, glibc provides no prototype for
217 .\"O .BR arch_prctl ().
218 .\"O You have to declare it yourself for now.
219 .\"O This may be fixed in future glibc versions.
220 バージョン 2.7 時点では、glibc には
221 .BR arch_prctl ()
222 のプロトタイプがない。
223 今のところユーザは自分自身で宣言する必要がある。
224 これは将来の glibc のバージョンで修正されるかもしれない。
225
226 .\"O .I FS
227 .\"O may be already used by the threading library.
228 .I FS
229 はスレッドライブラリで既に使われているかもしれない。
230 .\"O .SH "SEE ALSO"
231 .SH 関連項目
232 .BR mmap (2),
233 .BR modify_ldt (2),
234 .BR prctl (2),
235 .BR set_thread_area (2)
236 .sp
237 AMD X86-64 Programmer's manual