OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / prctl.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl)
4 .\" and Copyright (C) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\" and Copyright Guillem Jover <guillem@hadrons.org>
6 .\"
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
10 .\"
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
15 .\"
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein.  The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\"
27 .\" Modified Thu Nov 11 04:19:42 MET 1999, aeb: added PR_GET_PDEATHSIG
28 .\" Modified 27 Jun 02, Michael Kerrisk
29 .\"     Added PR_SET_DUMPABLE, PR_GET_DUMPABLE,
30 .\"     PR_SET_KEEPCAPS, PR_GET_KEEPCAPS
31 .\" Modified 2006-08-30 Guillem Jover <guillem@hadrons.org>
32 .\"     Updated Linux versions where the options where introduced.
33 .\"     Added PR_SET_TIMING, PR_GET_TIMING, PR_SET_NAME, PR_GET_NAME,
34 .\"     PR_SET_UNALIGN, PR_GET_UNALIGN, PR_SET_FPEMU, PR_GET_FPEMU,
35 .\"     PR_SET_FPEXC, PR_GET_FPEXC
36 .\" 2008-04-29 Serge Hallyn, Document PR_CAPBSET_READ and PR_CAPBSET_DROP
37 .\" 2008-06-13 Erik Bosman, <ejbosman@cs.vu.nl>
38 .\"     Document PR_GET_TSC and PR_SET_TSC.
39 .\" 2008-06-15 mtk, Document PR_SET_SECCOMP, PR_GET_SECCOMP
40 .\"
41 .\" Japanese Version Copyright (c) 1998-1999 HANATAKA Shinya
42 .\"         all rights reserved.
43 .\" Translated 1999-04-03, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
44 .\" Updated 2002-12-20, Kentaro Shirakata <argrath@ub32.org>
45 .\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
46 .\" Updated 2005-10-07, Akihiro MOTOKI
47 .\" Updated 2007-01-08, Akihiro MOTOKI, LDP v2.43
48 .\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66
49 .\" Updated 2008-08-12, Akihiro MOTOKI, LDP v3.05
50 .\"
51 .\"WORD:        capability      ケーパビリティ
52 .\"WORD:        keep capabilities       ケーパビリティ保持
53 .\"
54 .TH PRCTL 2 2008-07-16 "Linux" "Linux Programmer's Manual"
55 .\"O .SH NAME
56 .SH 名前
57 .\"O prctl \- operations on a process
58 prctl \- プロセスの操作を行なう
59 .\"O .SH SYNOPSIS
60 .SH 書式
61 .nf
62 .B #include <sys/prctl.h>
63 .sp
64 .BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 ,
65 .BI "          unsigned long " arg4 ", unsigned long " arg5 );
66 .fi
67 .\"O .SH DESCRIPTION
68 .SH 説明
69 .\"O .BR prctl ()
70 .\"O is called with a first argument describing what to do
71 .\"O (with values defined in \fI<linux/prctl.h>\fP), and further
72 .\"O arguments with a significance depending on the first one.
73 .\"O The first argument can be:
74 .BR prctl ()
75 の動作は最初の引き数によって決定される (この値は
76 \fI<linux/prctl.h>\fP に定義されている)。
77 残りの引き数は最初の引き数によって変化する。
78 一番目の引き数として以下のものを指定できる:
79 .TP
80 .\"O .BR PR_CAPBSET_READ " (since Linux 2.6.25)
81 .BR PR_CAPBSET_READ " (Linux 2.6.25 以降)"
82 .\"O Return (as the function result) 1 if the capability specified in
83 .\"O .I arg2
84 .\"O is in the calling thread's capability bounding set,
85 .\"O or 0 if it is not.
86 .\"O (The capability constants are defined in
87 .\"O .IR <linux/capability.h> .)
88 .\"O The capability bounding set dictates
89 .\"O whether the process can receive the capability through a
90 .\"O file's permitted capability set on a subsequent call to
91 .\"O .BR execve (2).
92 で指定されたケーパビリティが呼び出したスレッドのケーパビリティ
93 バインディングセット (capability bounding set) に含まれている場合、
94 (関数の返り値として) 1 を返し、そうでない場合 0 を返す
95 (ケーパビリティ定数は
96 .I <linux/capability.h>
97 で定義されている)。
98 ケーパビリティバウンディングセットは、
99 .BR execve (2)
100 を呼び出した際に、ファイルの許可 (permitted) ケーパビリティの中で
101 そのプロセスが獲得できるケーパビリティを指示するものである。
102
103 .\"O If the capability specified in
104 .\"O .I arg2
105 .\"O is not valid, then the call fails with the error
106 .\"O .BR EINVAL .
107 .I arg2
108 に指定されたケーパビリティが有効でない場合、
109 呼び出しはエラー
110 .B EINVAL
111 で失敗する。
112 .TP
113 .\"O .BR PR_CAPBSET_DROP " (since Linux 2.6.25)"
114 .BR PR_CAPBSET_DROP " (Linux 2.6.25 以降)"
115 .\"O If the calling thread has the
116 .\"O .B CAP_SETPCAP
117 .\"O capability, then drop the capability specified by
118 .\"O .I arg2
119 .\"O from the calling thread's capability bounding set.
120 .\"O Any children of the calling thread will inherit the newly
121 .\"O reduced bounding set.
122 呼び出したスレッドがケーパビリティ
123 .B CAP_SETPCAP
124 を持っている場合、
125 呼び出したスレッドのケーパビリティバウンディングセットから
126 .I arg2
127 で指定されたケーパビリティを外す。
128 呼び出したスレッドの子プロセスは変更後のバウンディングセットを
129 継承する。
130
131 .\"O The call fails with the error:
132 .\"O .B EPERM
133 .\"O if the calling thread does not have the
134 .\"O.BR CAP_SETPCAP ;
135 .\"O .BR EINVAL
136 .\"O if
137 .\"O .I arg2
138 .\"O does not represent a valid capability; or
139 .\"O .BR EINVAL
140 .\"O if file capabilities are not enabled in the kernel,
141 .\"O in which case bounding sets are not supported.
142 呼び出したスレッドが
143 .B CAP_SETPCAP
144 を持っていない場合、呼び出しはエラー
145 .B EPERM
146 で失敗する。
147 .I arg2
148 に指定されたケーパビリティが有効でない場合、
149 .B EINVAL
150 で失敗する。
151 ファイルケーパビリティがカーネルで有効になっていない場合
152 (この場合にはバウンディングセットがサポートされない)、
153 .B EINVAL
154 で失敗する。
155 .TP
156 .\"O .BR PR_SET_DUMPABLE " (since Linux 2.3.20)"
157 .BR PR_SET_DUMPABLE " (Linux 2.3.20 以降)"
158 .\"O Set the state of the flag determining whether core dumps are produced
159 .\"O for this process upon delivery of a signal whose default behavior is
160 .\"O to produce a core dump.
161 .\"O (Normally this flag is set for a process by default, but it is cleared
162 .\"O when a set-user-ID or set-group-ID program is executed and also by
163 .\"O various system calls that manipulate process UIDs and GIDs).
164 .\"O In kernels up to and including 2.6.12,
165 .\"O .I arg2
166 .\"O must be either 0 (process is not dumpable) or 1 (process is dumpable).
167 (Linux 2.3.20 以降)
168 デフォルトの振る舞いではコアダンプを引き起こすようなシグナルを受信したときに、
169 コアダンプするかどうかを決定するフラグを設定する
170 (通常このフラグは、デフォルトではセットされているが、
171 set-user-ID あるいは set-group-ID プログラムが実行されたり、
172 さまざまなシステムコールによってプロセスの UID や GID が操作されたときに
173 クリアされる)。
174 2.6.12 以前のカーネルでは、
175 .I arg2
176 は 0 (プロセスはダンプ不可) あるいは 1 (プロセスはダンプ可能) の
177 どちらかでなければならない。
178 .\"O Between kernels 2.6.13 and 2.6.17, the value 2 was also permitted,
179 .\"O which caused any binary which normally would not be dumped
180 .\"O to be dumped readable by root only;
181 .\"O for security reasons, this feature has been removed.
182 2.6.13 から 2.6.17 までのカーネルでは、値 2 も認められていた。
183 この値を指定すると、通常はダンプされないバイナリが root だけが
184 読み込み可能な形でダンプされた。
185 セキュリティ上の理由から、この機能は削除された
186 .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
187 .\" Subject:    Fix prctl privilege escalation (CVE-2006-2451)
188 .\" From:       Marcel Holtmann <marcel () holtmann ! org>
189 .\" Date:       2006-07-12 11:12:00
190 .\"O (See also the description of
191 .\"O .I /proc/sys/fs/suid_dumpable
192 .\"O in
193 .\"O .BR proc (5).)
194 .RB ( proc (5)
195
196 .I /proc/sys/fs/suid_dumpable
197 の説明も参照)。
198 .TP
199 .\"O .BR PR_GET_DUMPABLE " (since Linux 2.3.20)"
200 .BR PR_GET_DUMPABLE " (Linux 2.3.20 以降)"
201 .\"O Return (as the function result) the current state of the calling
202 .\"O process's dumpable flag.
203 (Linux 2.3.20 以降)
204 呼び出し元プロセスにおけるダンプ可能フラグの
205 現在の状態を (関数の返り値として) 返す。
206 .\"O .\" Since Linux 2.6.13, the dumpable flag can have the value 2,
207 .\"O .\" but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable
208 .\"O .\" flags has a nonzero value.  This was fixed in 2.6.14.
209 .\" [要修正] Linux 2.6.13 以降では、ダンプ可能フラグは値 2 をとることが
210 .\" できるが、2.6.13 では PR_GET_DUMPABLE はダンプ可能フラグが 0 以外の
211 .\" 値の場合 1 を返すだけである。これは 2.6.14 で修正された。
212 .TP
213 .\"O .BR PR_SET_ENDIAN " (since Linux 2.6.18, PowerPC only)"
214 .BR PR_SET_ENDIAN " (Linux 2.6.18 以降、PowerPC のみ)"
215 .\"O Set the endian-ness of the calling process to the value given
216 .\"O in \fIarg2\fP, which should be one of the following:
217 .\"O .\" Respectively 0, 1, 2
218 .\"O .BR PR_ENDIAN_BIG ,
219 .\"O .BR PR_ENDIAN_LITTLE ,
220 .\"O or
221 .\"O .B PR_ENDIAN_PPC_LITTLE
222 .\"O (PowerPC pseudo little endian).
223 呼び出し元プロセスのエンディアン設定 (endian-ness) を
224 \fIarg2\fP で指定された値に設定する。
225 指定できる値は
226 .\" それぞれ 0, 1, 2
227 .BR PR_ENDIAN_BIG ,
228 .BR PR_ENDIAN_LITTLE ,
229 .B PR_ENDIAN_PPC_LITTLE
230 (PowerPC 擬似リトルエンディアン)
231 のいずれか一つである。
232 .TP
233 .\"O .BR PR_GET_ENDIAN " (since Linux 2.6.18, PowerPC only)"
234 .BR PR_GET_ENDIAN " (Linux 2.6.18 以降、PowerPC のみ)"
235 .\"O Return the endian-ness of the calling process,
236 .\"O in the location pointed to by
237 .\"O .IR "(int\ *) arg2" .
238 呼び出し元プロセスのエンディアン設定 (endian-ness) を
239 .I "(int\ *) arg2"
240 が指す場所に格納して返す。
241 .TP
242 .\"O .BR PR_SET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)"
243 .BR PR_SET_FPEMU " (Linux 2.4.18 以降, 2.5.9, ia64 のみ)"
244 .\"O Set floating-point emulation control bits to \fIarg2\fP.
245 .\"O Pass \fBPR_FPEMU_NOPRINT\fP to silently emulate fp operations accesses, or
246 .\"O \fBPR_FPEMU_SIGFPE\fP to not emulate fp operations and send
247 .\"O .B SIGFPE
248 .\"O instead.
249 浮動小数点エミュレーション (floating-point emulation) 制御ビットを
250 \fIarg2\fP で指定された値に設定する。
251 指定できる値は \fBPR_FPEMU_NOPRINT\fP (浮動小数点命令アクセスを黙って
252 エミュレートする) か \fBPR_FPEMU_SIGFPE\fP (浮動小数点命令をエミュレートせず、
253 代わりに
254 .B SIGFPE
255 を送る) である。
256 .TP
257 .\"O .BR PR_GET_FPEMU " (since Linux 2.4.18, 2.5.9, only on ia64)"
258 .BR PR_GET_FPEMU " (Linux 2.4.18 以降, 2.5.9, ia64 のみ)"
259 .\"O Return floating-point emulation control bits,
260 .\"O in the location pointed to by
261 .\"O .IR "(int\ *) arg2" .
262 浮動小数点エミュレーション制御ビットの値を
263 .I "(int\ *) arg2"
264 が指す場所に格納して返す。
265 .TP
266 .\"O .BR PR_SET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)"
267 .BR PR_SET_FPEXC " (Linux 2.4.21 および 2.5.32 以降、PowerPC のみ)"
268 .\"O Set floating-point exception mode to \fIarg2\fP.
269 .\"O Pass \fBPR_FP_EXC_SW_ENABLE\fP to use FPEXC for FP exception enables,
270 .\"O \fBPR_FP_EXC_DIV\fP for floating-point divide by zero,
271 .\"O \fBPR_FP_EXC_OVF\fP for floating-point overflow,
272 .\"O \fBPR_FP_EXC_UND\fP for floating-point underflow,
273 .\"O \fBPR_FP_EXC_RES\fP for floating-point inexact result,
274 .\"O \fBPR_FP_EXC_INV\fP for floating-point invalid operation,
275 .\"O \fBPR_FP_EXC_DISABLED\fP for FP exceptions disabled,
276 .\"O \fBPR_FP_EXC_NONRECOV\fP for async nonrecoverable exception mode,
277 .\"O \fBPR_FP_EXC_ASYNC\fP for async recoverable exception mode,
278 .\"O \fBPR_FP_EXC_PRECISE\fP for precise exception mode.
279 浮動小数点例外モード (floating-point exception mode) を
280 \fIarg2\fP で指定された値に設定する。
281 指定できるのは以下の値である:
282 \fBPR_FP_EXC_SW_ENABLE\fP (FPEXC で浮動小数点例外を有効にする)、
283 \fBPR_FP_EXC_DIV\fP (0 除算)、
284 \fBPR_FP_EXC_OVF\fP (オーバーフロー)、
285 \fBPR_FP_EXC_UND\fP (アンダーフロー)、
286 \fBPR_FP_EXC_RES\fP (不正確な結果 (inexact result))、
287 \fBPR_FP_EXC_INV\fP (不正な命令 (invalid operation))、
288 \fBPR_FP_EXC_DISABLED\fP (浮動小数点例外を無効にする)、
289 \fBPR_FP_EXC_NONRECOV\fP (async nonrecoverable exception mode)、
290 \fBPR_FP_EXC_ASYNC\fP (async recoverable exception mode)、
291 \fBPR_FP_EXC_PRECISE\fP (precise exception mode)。
292 .TP
293 .\"O .BR PR_GET_FPEXC " (since Linux 2.4.21, 2.5.32, only on PowerPC)"
294 .BR PR_GET_FPEXC "(Linux 2.4.21 および 2.5.32 以降、PowerPC のみ)"
295 .\"O Return floating-point exception mode,
296 .\"O in the location pointed to by
297 .\"O .IR "(int\ *) arg2" .
298 浮動小数点例外モードの値を
299 .I "(int\ *) arg2"
300 が指す場所に格納して返す。
301 .TP
302 .\"O .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)"
303 .BR PR_SET_KEEPCAPS " (Linux 2.2.18 以降)"
304 .\"O Set the state of the thread's "keep capabilities" flag,
305 .\"O which determines whether the threads's effective and permitted
306 .\"O capability sets are cleared when a change is made to the threads's user IDs
307 .\"O such that the threads's real UID, effective UID, and saved set-user-ID
308 .\"O all become nonzero when at least one of them previously had the value 0.
309 .\"O (By default, these credential sets are cleared).
310 .\"O .I arg2
311 .\"O must be either 0 (capabilities are cleared) or 1 (capabilities are kept).
312 .\"O This value will be reset to 0 on subsequent calls to
313 .\"O .BR execve (2).
314 スレッドの「ケーパビリティ保持」フラグを設定する。
315 このフラグは、スレッドの実 UID、実効 UID、保存 set-user-ID のうち少なくとも
316 一つが 0 であった状態から、これら全てが 0 以外に変更されたとき、
317 スレッドの実効/許可のケーパビリティ集合がクリアされるかどうかを決定する
318 (デフォルトでは、これらのケーパビリティ集合はクリアされる)。
319 .I arg2
320 は 0 (ケーパビリティをクリアする) あるいは 1 (ケーパビリティを保持する) の
321 どちらかでなければならない。
322 .BR execve (2)
323 が呼び出されると、この値は 0 にリセットされる。
324 .TP
325 .\"O .BR PR_GET_KEEPCAPS " (since Linux 2.2.18)"
326 .BR PR_GET_KEEPCAPS " (Linux 2.2.18 以降)"
327 .\"O Return (as the function result) the current state of the calling threads's
328 .\"O "keep capabilities" flag.
329 呼び出し元スレッドにおける「ケーパビリティ保持」フラグの
330 現在の状態を (関数の返り値として) 返す。
331 .TP
332 .\"O .BR PR_SET_NAME " (since Linux 2.6.9)"
333 .BR PR_SET_NAME " (Linux 2.6.9 以降)"
334 .\"O Set the process name for the calling process,
335 .\"O using the value in the location pointed to by
336 .\"O .IR "(char\ *) arg2" .
337 .\"O The name can be up to 16 bytes long,
338 .\"O .\" TASK_COMM_LEN in include/linux/sched.h
339 .\"O and should be null-terminated if it contains fewer bytes.
340 呼び出し元プロセスのプロセス名を
341 .I "(char\ *) arg2"
342 が指す場所に格納された値を使って設定する。
343 名前は最大で 16 バイトであり、
344 .\" TASK_COMM_LEN in include/linux/sched.h
345 それより少ないバイト数の場合は NULL で終端すべきである。
346 .TP
347 .\"O .BR PR_GET_NAME " (since Linux 2.6.11)"
348 .BR PR_GET_NAME " (Linux 2.6.11 以降)"
349 .\"O Return the process name for the calling process,
350 .\"O in the buffer pointed to by
351 .\"O .IR "(char\ *) arg2" .
352 .\"O The buffer should allow space for up to 16 bytes;
353 .\"O the returned string will be null-terminated if it is shorter than that.
354 呼び出し元プロセスのプロセス名を
355 .I "(char\ *) arg2"
356 が指す場所に格納して返す。
357 バッファは最大で 16 バイトを格納できるようにすべきである。
358 返される文字列は、長さが 16 バイトより短い場合は NULL 終端される。
359 .TP
360 .\"O .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)"
361 .BR PR_SET_PDEATHSIG " (Linux 2.1.57 以降)"
362 .\"O Set the parent process death signal
363 .\"O of the calling process to \fIarg2\fP (either a signal value
364 .\"O in the range 1..maxsig, or 0 to clear).
365 .\"O This is the signal that the calling process will get when its
366 .\"O parent dies.
367 .\"O This value is cleared for the child of a
368 .\"O .BR fork (2).
369 親プロセス死亡シグナル (parent process death signal) を \fIarg2\fP に設定する
370 (設定できるシグナル値の範囲は 1..maxsig であり、0 は通知の解除である)。
371 呼び出し元プロセスの親プロセスが死んだ際に、ここで設定した値が
372 シグナルとして通知される。この値は
373 .BR fork (2)
374 の子プロセスでは解除される。
375 .TP
376 .\"O .BR PR_GET_PDEATHSIG " (since Linux 2.3.15)"
377 .BR PR_GET_PDEATHSIG " (Linux 2.3.15 以降)"
378 .\"O Return the current value of the parent process death signal,
379 .\"O in the location pointed to by
380 .\"O .IR "(int\ *) arg2" .
381 親プロセス死亡シグナルの現在の値を
382 .I "(int\ *) arg2"
383 が指す場所に格納して返す。
384 .TP
385 .\"O .BR PR_SET_SECCOMP " (since Linux 2.6.23)"
386 .BR PR_SET_SECCOMP " (Linux 2.6.23 以降)"
387 .\" See http://thread.gmane.org/gmane.linux.kernel/542632
388 .\" [PATCH 0 of 2] seccomp updates
389 .\" andrea@cpushare.com
390 .\"O Set the secure computing mode for the calling thread.
391 .\"O In the current implementation,
392 .\"O .IR arg2
393 .\"O must be 1.
394 呼び出したスレッドの secure computing モードを設定する。
395 現在の実装では、
396 .I arg2
397 は 1 にしなければならない。
398 .\"O After the secure computing mode has been set to 1,
399 .\"O the only system calls that the thread is permitted to make are
400 .\"O .BR read (2),
401 .\"O .BR write (2),
402 .\"O .BR _exit (2),
403 .\"O and
404 .\"O .BR sigreturn (2).
405 .\"O Other system calls result in the delivery of a
406 .\"O .BR SIGKILL
407 .\"O signal.
408 secure computing モードを 1 に設定すると、
409 そのスレッドが呼び出しを許可されるシステムコールは
410 .BR read (2),
411 .BR write (2),
412 .BR _exit (2),
413 .BR sigreturn (2)
414 だけになる。
415 それ以外のシステムコールを呼び出すと、シグナル
416 .B SIGKILL
417 が配送される。
418 .\"O Secure computing mode is useful for number-crunching applications
419 .\"O that may need to execute untrusted byte code,
420 .\"O perhaps obtained by reading from a pipe or socket.
421 .\"O This operation is only available
422 .\"O if the kernel is configured with CONFIG_SECCOMP enabled.
423 パイプやソケットから読み込んだ、信頼できないバイトコードを実行する
424 必要がある大量の演算を行うアプリケーションにおいて、
425 secure computing モードは役立つ。
426 この操作は利用できるのは、カーネルが CONFIG_SECCOMP を有効にして
427 作成されている場合だけである。
428 .TP
429 .\"O .BR PR_GET_SECCOMP " (since Linux 2.6.23)"
430 .BR PR_GET_SECCOMP " (Linux 2.6.23 以降)"
431 .\"O Return the secure computing mode of the calling thread.
432 .\"O Not very useful for the current implementation (mode equals 1),
433 .\"O but may be useful for other possible future modes:
434 .\"O if the caller is not in secure computing mode, this operation returns 0;
435 .\"O if the caller is in secure computing mode, then the
436 .\"O .BR prctl ()
437 .\"O call will cause a
438 .\"O .B SIGKILL
439 .\"O signal to be sent to the process.
440 .\"O This operation is only available
441 .\"O if the kernel is configured with CONFIG_SECCOMP enabled.
442 呼び出したスレッドの secure computing モードを返す。
443 現在の実装 (モードは 1 固定) はあまり役に立たないが、
444 将来他のモードが実装されると役立つようになるかもしれない。
445 呼び出したスレッドが secure computing モードでなかった場合、
446 この操作は 0 を返す。
447 呼び出したスレッドが secure computing モードの場合、
448 .BR prctl ()
449 を呼び出すとシグナル
450 .B SIGKILL
451 がそのプロセスに送信される。
452 この操作が利用できるのは、カーネルが CONFIG_SECCOMP を有効にして
453 作成されている場合だけである。
454 .TP
455 .\"O .BR PR_SET_SECUREBITS " (since Linux 2.6.26)"
456 .BR PR_SET_SECUREBITS " (Linux 2.6.26 以降)"
457 .\"O Set the "securebits" flags of the calling thread to the value supplied in
458 .\"O .IR arg2 .
459 .\"O See
460 .\"O .BR capabilities (7).
461 呼び出したスレッドの "securebits" フラグを
462 .I arg2
463 で渡された値に設定する。
464 .BR capabilities (7)
465 参照。
466 .TP
467 .\"O .BR PR_GET_SECUREBITS " (since Linux 2.6.26)"
468 .BR PR_GET_SECUREBITS " (Linux 2.6.26 以降)"
469 .\"O Return (as the function result)
470 .\"O the "securebits" flags of the calling thread.
471 .\"O See
472 .\"O .BR capabilities (7).
473 呼び出したスレッドの "securebits" フラグを
474 (関数の返り値として) 返す。
475 .BR capabilities (7)
476 参照。
477 .TP
478 .\"O .BR PR_SET_TIMING " (since Linux 2.6.0-test4)"
479 .BR PR_SET_TIMING " (Linux 2.6.0-test4 以降)"
480 .\"O Set whether to use (normal, traditional) statistical process timing or
481 .\"O accurate timestamp based process timing, by passing
482 .\"O .B PR_TIMING_STATISTICAL
483 .\"O .\" 0
484 .\"O or
485 .\"O .B PR_TIMING_TIMESTAMP
486 .\"O .\" 1
487 .\"O to \fIarg2\fP.
488 .\"O .B PR_TIMING_TIMESTAMP
489 .\"O is not currently implemented
490 .\"O (attempting to set this mode will yield the error
491 .\"O .BR EINVAL ).
492 .\"O .\" PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8,
493 .\"O .\" and looking at the patch history, it appears
494 .\"O .\" that it never did anything.
495 (通常の、伝統的に使われてきた) 統計的なプロセスタイミングを使用するか、
496 正確なタイムスタンプに基づくプロセスタイミングを使用するかを設定する。
497 \fIarg2\fP に指定できる値は
498 .B PR_TIMING_STATISTICAL
499 .\" 0
500
501 .B PR_TIMING_TIMESTAMP
502 .\" 1
503 である。
504 .B PR_TIMING_TIMESTAMP
505 は現在のところ実装されていない
506 (このモードに設定しようとするとエラー
507 .B EINVAL
508 が起こることだろう)。
509 .\" 2.6.26-rc8 では PR_TIMING_TIMESTAMP は何もしない。
510 .\" パッチの履歴を見たが、過去にも何かをしたこともない。
511 .TP
512 .\"O .BR PR_GET_TIMING " (since Linux 2.6.0-test4)"
513 .BR PR_GET_TIMING " (Linux 2.6.0-test4 以降)"
514 .\"O Return (as the function result) which process timing method is currently
515 .\"O in use.
516 現在使用中のプロセスタイミングを決める方法を返す。
517 .TP
518 .\"O .BR PR_SET_TSC " (since Linux 2.6.26, x86 only)"
519 .BR PR_SET_TSC " (Linux 2.6.26 以降, x86 のみ)"
520 .\"O Set the state of the flag determining whether the timestamp counter
521 .\"O can be read by the process.
522 .\"O Pass
523 .\"O .B PR_TSC_ENABLE
524 .\"O to
525 .\"O .I arg2
526 .\"O to allow it to be read, or
527 .\"O .B PR_TSC_SIGSEGV
528 .\"O to generate a
529 .\"O .B SIGSEGV
530 .\"O when the process tries to read the timestamp counter.
531 そのプロセスがタイムスタンプ・カウンタを読み出せるかを決定する
532 フラグの状態を設定する。
533 読み出しを許可する場合は
534 .I arg2
535
536 .B PR_TSC_ENABLE
537 を、そのプロセスがタイムスタンプ・カウンタを読み出そうとした際に
538 .B SIGSEGV
539 を発生させる場合には
540 .B PR_TSC_SIGSEGV
541 を渡す。
542 .TP
543 .\"O .BR PR_GET_TSC " (since Linux 2.6.26, x86 only)"
544 .BR PR_GET_TSC " (Linux 2.6.26 以降, x86 のみ)"
545 .\"O Return the state of the flag determining whether the timestamp counter
546 .\"O can be read,
547 .\"O in the location pointed to by
548 .\"O .IR "(int\ *) arg2" .
549 そのプロセスがタイムスタンプ・カウンタを読み出せるかを決定する
550 フラグの状態を
551 .I "(int\ *) arg2"
552 が指す場所に格納して返す。
553 .TP
554 .B PR_SET_UNALIGN
555 .\"O (Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15;
556 .\"O PowerPC, since Linux 2.6.18; Alpha, since Linux 2.6.22)
557 (ia64 では Linux 2.3.48 以降;
558 parisc では Linux 2.6.15 以降;
559 PowerPC では Linux 2.6.18 以降;
560 Alpha では Linux 2.6.22 以降;
561 これらのアーキテクチャのみ)
562 .\"O Set unaligned access control bits to \fIarg2\fP.
563 .\"O Pass
564 .\"O \fBPR_UNALIGN_NOPRINT\fP to silently fix up unaligned user accesses,
565 .\"O or \fBPR_UNALIGN_SIGBUS\fP to generate
566 .\"O .B SIGBUS
567 .\"O on unaligned user access.
568 unaligned アクセス制御ビットを \fIarg2\fP で指定された値に設定する。
569 指定できる値は \fBPR_UNALIGN_NOPRINT\fP (unaligned なユーザアクセスを黙って
570 修正する) か \fBPR_UNALIGN_SIGBUS\fP (unaligned なユーザアクセスがあった場合
571 .B SIGBUS
572 を生成する) である。
573 .TP
574 .B PR_GET_UNALIGN
575 .\"O (see
576 .\"O .B PR_SET_UNALIGN
577 .\"O for information on versions and architectures)
578 (バージョンとアーキテクチャの情報は
579 .B PR_SET_UNALIGN
580 参照)
581 .\"O Return unaligned access control bits, in the location pointed to by
582 .\"O .IR "(int\ *) arg2" .
583 unaligned アクセス制御ビットの値を
584 .I "(int\ *) arg2"
585 が指す場所に格納して返す。
586 .\"O .SH "RETURN VALUE"
587 .SH 返り値
588 .\"O On success,
589 .\"O .BR PR_GET_DUMPABLE ,
590 .\"O .BR PR_GET_KEEPCAPS ,
591 .\"O .BR PR_CAPBSET_READ ,
592 .\"O .BR PR_GET_TIMING ,
593 .\"O .BR PR_GET_SECUREBITS ,
594 .\"O and (if it returns)
595 .\"O .BR PR_GET_SECCOMP
596 .\"O return the nonnegative values described above.
597 成功すると、
598 .BR PR_GET_DUMPABLE ,
599 .BR PR_GET_KEEPCAPS ,
600 .BR PR_CAPBSET_READ ,
601 .BR PR_GET_TIMING ,
602 .BR PR_GET_SECUREBITS ,
603 .BR PR_GET_SECCOMP
604 は上述の負でない値を返す
605 .RB ( PR_GET_SECCOMP
606 は返らない場合もある)。
607 .\"O All other
608 .\"O .I option
609 .\"O values return 0 on success.
610 .I option
611 が他の値の場合は成功時に 0 を返す。
612 .\"O On error, \-1 is returned, and
613 .\"O .I errno
614 .\"O is set appropriately.
615 エラーの場合、\-1 を返し、
616 .I errno
617 に適切な値を設定する。
618 .\"O .SH ERRORS
619 .SH エラー
620 .TP
621 .B EFAULT
622 .\"O .I arg2
623 .\"O is an invalid address.
624 .I arg2
625 が不正なアドレスである。
626 .TP
627 .B EINVAL
628 .\"O The value of
629 .\"O .I option
630 .\"O is not recognized
631 .I option
632 の値が理解できない。
633 .TP
634 .B EINVAL
635 .\"O .I arg2
636 .\"O is not valid value for this
637 .\"O .IR option .
638 .I arg2
639 が指定された
640 .I option
641 で有効な値ではない。
642 .TP
643 .B EINVAL
644 .\"O .I option
645 .\"O is
646 .\"O .BR PR_SET_SECCOMP
647 .\"O or
648 .\"O .BR PR_SET_SECCOMP ,
649 .\"O and the kernel was not configured with
650 .\"O .BR CONFIG_SECCOMP .
651 .I option
652
653 .BR PR_SET_SECCOMP
654
655 .BR PR_GET_SECCOMP
656 だが、カーネルが
657 .B CONFIG_SECCOMP
658 を有効にして作成されていなかった。
659 .TP
660 .B EPERM
661 .\"O .I option
662 .\"O is
663 .\"O .BR PR_SET_SECUREBITS ,
664 .\"O and the caller does not have the
665 .\"O .B CAP_SETPCAP
666 .\"O capability,
667 .\"O or tried to unset a "locked" flag,
668 .\"O or tried to set a flag whose corresponding locked flag was set
669 .\"O (see
670 .\"O .BR capabilities (7)).
671 .I option
672
673 .B PR_SET_SECUREBITS
674 で、呼び出し元がケーパビリティ
675 .B CAP_SETPCAP
676 を持っていない。
677 または、"locked" フラグを解除しようとした。
678 または、locked フラグがセットされているフラグをセットしようとした
679 .RB ( capabilities (7)
680 参照)。
681 .TP
682 .B EPERM
683 .\"O .I option
684 .\"O is
685 .\"O .BR PR_SET_KEEPCAPS ,
686 .\"O and the callers's
687 .\"O .B SECURE_KEEP_CAPS_LOCKED
688 .\"O flag is set
689 .\"O (see
690 .\"O .BR capabilities (7)).
691 .I option
692
693 .B PR_SET_KEEPCAPS
694 で、呼び出し元のフラグ
695 .B SECURE_KEEP_CAPS_LOCKED
696 がセットされている
697 .RB ( capabilities (7)
698 参照)。
699 .TP
700 .B EPERM
701 .\"O .I option
702 .\"O is
703 .\"O .BR PR_CAPBSET_DROP ,
704 .\"O and the caller does not have the
705 .\"O .B CAP_SETPCAP
706 .\"O capability.
707 .I option
708
709 .B PR_CAPBSET_DROP
710 で、呼び出し元がケーパビリティ
711 .B CAP_SETPCAP
712 を持っていない。
713 .\" The following can't actually happen, because prctl() in
714 .\" seccomp mode will cause SIGKILL.
715 .\" .TP
716 .\" .B EPERM
717 .\" .I option
718 .\" is
719 .\" .BR PR_SET_SECCOMP ,
720 .\" and secure computing mode is already 1.
721 .\"O .SH VERSIONS
722 .SH バージョン
723 .\"O The
724 .\"O .BR prctl ()
725 .\"O system call was introduced in Linux 2.1.57.
726 .\"O .\" The library interface was added in glibc 2.0.6
727 .BR prctl ()
728 システムコールは Linux 2.1.57 で導入された。
729 .\" ライブラリ・インタフェースは glibc 2.0.6 で追加された。
730 .\"O .SH "CONFORMING TO"
731 .SH 準拠
732 .\"O This call is Linux-specific.
733 .\"O IRIX has a
734 .\"O .BR prctl ()
735 .\"O system call (also introduced in Linux 2.1.44
736 .\"O as irix_prctl on the MIPS architecture),
737 .\"O with prototype
738 このコールは Linux 特有である。
739 IRIX には
740 .BR prctl ()
741 システム・コールがあるが (MIPS アーキテクチャにおいて
742 irix_prctl として Linux 2.1.44 で同様に導入された)、
743 そのプロトタイプは
744 .sp
745 .BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 );
746 .sp
747 .\"O and options to get the maximum number of processes per user,
748 .\"O get the maximum number of processors the calling process can use,
749 .\"O find out whether a specified process is currently blocked,
750 .\"O get or set the maximum stack size, etc.
751 である。ユーザー当りのプロセス最大数を取得するオプション、
752 プロセスの使用できる最大プロッサー数を取得するオプション、
753 現在特定のプロセスが停止(block)させられているかどうか調べるオプション、
754 スタックサイズの最大値の取得や設定を行なうオプションなどがある。
755 .\"O .SH "SEE ALSO"
756 .SH 関連項目
757 .BR signal (2),
758 .BR core (5)