OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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