OSDN Git Service

(split) LDP: Release pages with over 80% translations.
[linuxjm/LDP_man-pages.git] / release / 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 .\" 2009-10-03 Andi Kleen, document PR_MCE_KILL
41 .\" 2012-04 Cyrill Gorcunov, Document PR_SET_MM
42 .\" 2012-04-25 Michael Kerrisk, Document PR_TASK_PERF_EVENTS_DISABLE and
43 .\"                             PR_TASK_PERF_EVENTS_ENABLE
44 .\"
45 .\" FIXME: Document PR_SET_TIMERSLACK and PR_GET_TIMERSLACK (new in 2.6.28)
46 .\"             commit 6976675d94042fbd446231d1bd8b7de71a980ada
47 .\"
48 .\"*******************************************************************
49 .\"
50 .\" This file was generated with po4a. Translate the source file.
51 .\"
52 .\"*******************************************************************
53 .TH PRCTL 2 2012\-04\-23 Linux "Linux Programmer's Manual"
54 .SH 名前
55 prctl \- プロセスの操作を行なう
56 .SH 書式
57 .nf
58 \fB#include <sys/prctl.h>\fP
59 .sp
60 \fBint prctl(int \fP\fIoption\fP\fB, unsigned long \fP\fIarg2\fP\fB, unsigned long \fP\fIarg3\fP\fB,\fP
61 \fB          unsigned long \fP\fIarg4\fP\fB, unsigned long \fP\fIarg5\fP\fB);\fP
62 .fi
63 .SH 説明
64 \fBprctl\fP()  の動作は最初の引き数によって決定される (この値は \fI<linux/prctl.h>\fP に定義されている)。
65 残りの引き数は最初の引き数によって変化する。 一番目の引き数として以下のものを指定できる:
66 .TP 
67 \fBPR_CAPBSET_READ\fP (Linux 2.6.25 以降)
68 で指定されたケーパビリティが呼び出したスレッドのケーパビリティ バインディングセット (capability bounding set)
69 に含まれている場合、 (関数の返り値として) 1 を返し、そうでない場合 0 を返す (ケーパビリティ定数は
70 \fI<linux/capability.h>\fP で定義されている)。 ケーパビリティバウンディングセットは、 \fBexecve\fP(2)
71 を呼び出した際に、ファイルの許可 (permitted) ケーパビリティの中で そのプロセスが獲得できるケーパビリティを指示するものである。
72
73 \fIarg2\fP に指定されたケーパビリティが有効でない場合、 呼び出しはエラー \fBEINVAL\fP で失敗する。
74 .TP 
75 \fBPR_CAPBSET_DROP\fP (Linux 2.6.25 以降)
76 呼び出したスレッドがケーパビリティ \fBCAP_SETPCAP\fP を持っている場合、 呼び出したスレッドのケーパビリティバウンディングセットから
77 \fIarg2\fP で指定されたケーパビリティを外す。 呼び出したスレッドの子プロセスは変更後のバウンディングセットを 継承する。
78
79 呼び出したスレッドが \fBCAP_SETPCAP\fP を持っていない場合、呼び出しはエラー \fBEPERM\fP で失敗する。 \fIarg2\fP
80 に指定されたケーパビリティが有効でない場合、 \fBEINVAL\fP で失敗する。 ファイルケーパビリティがカーネルで有効になっていない場合
81 (この場合にはバウンディングセットがサポートされない)、 \fBEINVAL\fP で失敗する。
82 .TP 
83 \fBPR_SET_DUMPABLE\fP (Linux 2.3.20 以降)
84 .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
85 .\" Subject:    Fix prctl privilege escalation (CVE-2006-2451)
86 .\" From:       Marcel Holtmann <marcel () holtmann ! org>
87 .\" Date:       2006-07-12 11:12:00
88 (Linux 2.3.20 以降) デフォルトの振る舞いではコアダンプを引き起こすよう
89 なシグナルを受信したときに、 コアダンプするかどうかを決定するフラグを
90 設定する (通常このフラグは、デフォルトではセットされているが、
91 set\-user\-ID あるいは set\-group\-ID プログラムが実行されたり、 さまざまな
92 システムコールによってプロセスの UID や GID が操作されたときに クリアさ
93 れる)。 2.6.12 以前のカーネルでは、 \fIarg2\fP は 0 (プロセスはダンプ不可)
94 あるいは 1 (プロセスはダンプ可能) の どちらかでなければならない。
95 2.6.13 から 2.6.17 までのカーネルでは、値 2 も認められていた。 この値を
96 指定すると、通常はダンプされないバイナリが root だけが 読み込み可能な形
97 でダンプされた。 セキュリティ上の理由から、この機能は削除された
98 (\fBproc\fP(5) の \fI/proc/sys/fs/suid_dumpable\fP の説明も参照)。
99 ダンプ不可のプロセスを \fBptrace(2)\fP \fBPTRACE_ATTACH\fP 経由で接続すること
100 はできない。
101 .TP 
102 \fBPR_GET_DUMPABLE\fP (Linux 2.3.20 以降)
103 .\" Since Linux 2.6.13, the dumpable flag can have the value 2,
104 .\" but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable
105 .\" flags has a nonzero value.  This was fixed in 2.6.14.
106 (Linux 2.3.20 以降)  呼び出し元プロセスにおけるダンプ可能フラグの 現在の状態を (関数の返り値として) 返す。
107 .TP 
108 \fBPR_SET_ENDIAN\fP (Linux 2.6.18 以降、PowerPC のみ)
109 .\" Respectively 0, 1, 2
110 呼び出し元プロセスのエンディアン設定 (endian\-ness) を \fIarg2\fP で指定された値に設定する。 指定できる値は
111 \fBPR_ENDIAN_BIG\fP, \fBPR_ENDIAN_LITTLE\fP, \fBPR_ENDIAN_PPC_LITTLE\fP (PowerPC
112 擬似リトルエンディアン)  のいずれか一つである。
113 .TP 
114 \fBPR_GET_ENDIAN\fP (Linux 2.6.18 以降、PowerPC のみ)
115 呼び出し元プロセスのエンディアン設定 (endian\-ness) を \fI(int\ *) arg2\fP が指す場所に格納して返す。
116 .TP 
117 \fBPR_SET_FPEMU\fP (Linux 2.4.18 以降, 2.5.9, ia64 のみ)
118 浮動小数点エミュレーション (floating\-point emulation) 制御ビットを \fIarg2\fP で指定された値に設定する。
119 指定できる値は \fBPR_FPEMU_NOPRINT\fP (浮動小数点命令アクセスを黙って エミュレートする) か \fBPR_FPEMU_SIGFPE\fP
120 (浮動小数点命令をエミュレートせず、 代わりに \fBSIGFPE\fP を送る) である。
121 .TP 
122 \fBPR_GET_FPEMU\fP (Linux 2.4.18 以降, 2.5.9, ia64 のみ)
123 浮動小数点エミュレーション制御ビットの値を \fI(int\ *) arg2\fP が指す場所に格納して返す。
124 .TP 
125 \fBPR_SET_FPEXC\fP (Linux 2.4.21 および 2.5.32 以降、PowerPC のみ)
126 浮動小数点例外モード (floating\-point exception mode) を \fIarg2\fP で指定された値に設定する。
127 指定できるのは以下の値である: \fBPR_FP_EXC_SW_ENABLE\fP (FPEXC で浮動小数点例外を有効にする)、
128 \fBPR_FP_EXC_DIV\fP (0 除算)、 \fBPR_FP_EXC_OVF\fP (オーバーフロー)、 \fBPR_FP_EXC_UND\fP
129 (アンダーフロー)、 \fBPR_FP_EXC_RES\fP (不正確な結果 (inexact result))、 \fBPR_FP_EXC_INV\fP
130 (不正な命令 (invalid operation))、 \fBPR_FP_EXC_DISABLED\fP (浮動小数点例外を無効にする)、
131 \fBPR_FP_EXC_NONRECOV\fP (async nonrecoverable exception mode)、
132 \fBPR_FP_EXC_ASYNC\fP (async recoverable exception mode)、 \fBPR_FP_EXC_PRECISE\fP
133 (precise exception mode)。
134 .TP 
135 \fBPR_GET_FPEXC\fP(Linux 2.4.21 および 2.5.32 以降、PowerPC のみ)
136 浮動小数点例外モードの値を \fI(int\ *) arg2\fP が指す場所に格納して返す。
137 .TP 
138 \fBPR_SET_KEEPCAPS\fP (Linux 2.2.18 以降)
139 スレッドの「ケーパビリティ保持」フラグを設定する。
140 このフラグは、スレッドの実 UID、実効 UID、保存 set\-user\-ID のうち少なく
141 とも一つが 0 であった状態から、これら全てが 0 以外に変更されたとき、
142 スレッドの許可ケーパビリティ集合がクリアされるかどうかを決定する。
143 デフォルトでは、このような変更が行われた場合、許可ケーパビリティセット
144 はクリアされる。「ケーパビリティ保持」フラグを設定すると、
145 許可ケーパビリティセットはクリアされなくなる。
146 \fIarg2\fP は 0 (許可ケーパビリティをクリアする) か 1 (許可ケーパビリティ
147 を保持する) の どちらかでなければならない。
148 (このような ID の変更が行われた場合、「ケーパビリティ保持」フラグの設定
149 に関わらず、スレッドの\fI実効\fPケーパビリティセットは常にクリアされる。)
150 \fBexecve\fP(2) が呼び出されると、「ケーパビリティ保持」フラグは 0
151 にリセットされる。
152 .TP 
153 \fBPR_GET_KEEPCAPS\fP (Linux 2.2.18 以降)
154 呼び出し元スレッドにおける「ケーパビリティ保持」フラグの 現在の状態を (関数の返り値として) 返す。
155 .TP 
156 \fBPR_SET_NAME\fP (Linux 2.6.9 以降)
157 .\" TASK_COMM_LEN in include/linux/sched.h
158 呼び出し元プロセスのプロセス名を \fI(char\ *) arg2\fP が指す場所に格納された値を使って設定する。 名前は最大で 16 バイトであり、
159 それより少ないバイト数の場合は NULL で終端すべきである。
160 .TP 
161 \fBPR_GET_NAME\fP (Linux 2.6.11 以降)
162 呼び出し元プロセスのプロセス名を \fI(char\ *) arg2\fP が指す場所に格納して返す。 バッファは最大で 16
163 バイトを格納できるようにすべきである。 返される文字列は、長さが 16 バイトより短い場合は NULL 終端される。
164 .TP 
165 \fBPR_SET_PDEATHSIG\fP (Linux 2.1.57 以降)
166 親プロセス死亡シグナル (parent process death signal) を \fIarg2\fP に設定
167 する (設定できるシグナル値の範囲は 1..maxsig であり、0 は通知の解除であ
168 る)。 呼び出し元プロセスの親プロセスが死んだ際に、ここで設定した値が シ
169 グナルとして通知される。この値は \fBfork\fP(2) の子プロセスでは解除される。
170 (Linux 2.5.36 以降および 2.6.23 以降では) set\-user\-ID もしくは
171 set\-group\-ID されたバイナリを実行した場合にも、このフラグは解除される。
172 .TP 
173 \fBPR_GET_PDEATHSIG\fP (Linux 2.3.15 以降)
174 親プロセス死亡シグナルの現在の値を \fI(int\ *) arg2\fP が指す場所に格納して返す。
175 .TP 
176 \fBPR_SET_SECCOMP\fP (Linux 2.6.23 以降)
177 .\" See http://thread.gmane.org/gmane.linux.kernel/542632
178 .\" [PATCH 0 of 2] seccomp updates
179 .\" andrea@cpushare.com
180 呼び出したスレッドの secure computing モードを設定する。 現在の実装では、 \fIarg2\fP は 1 にしなければならない。
181 secure computing モードを 1 に設定すると、 そのスレッドが呼び出しを許可されるシステムコールは \fBread\fP(2),
182 \fBwrite\fP(2), \fB_exit\fP(2), \fBsigreturn\fP(2)  だけになる。 それ以外のシステムコールを呼び出すと、シグナル
183 \fBSIGKILL\fP が配送される。 パイプやソケットから読み込んだ、信頼できないバイトコードを実行する
184 必要がある大量の演算を行うアプリケーションにおいて、 secure computing モードは役立つ。 この操作は利用できるのは、カーネルが
185 CONFIG_SECCOMP を有効にして 作成されている場合だけである。
186 .TP 
187 \fBPR_GET_SECCOMP\fP (Linux 2.6.23 以降)
188 呼び出したスレッドの secure computing モードを返す。 現在の実装 (モードは 1 固定) はあまり役に立たないが、
189 将来他のモードが実装されると役立つようになるかもしれない。 呼び出したスレッドが secure computing モードでなかった場合、 この操作は
190 0 を返す。 呼び出したスレッドが secure computing モードの場合、 \fBprctl\fP()  を呼び出すとシグナル \fBSIGKILL\fP
191 がそのプロセスに送信される。 この操作が利用できるのは、カーネルが CONFIG_SECCOMP を有効にして 作成されている場合だけである。
192 .TP 
193 \fBPR_SET_SECUREBITS\fP (Linux 2.6.26 以降)
194 呼び出したスレッドの "securebits" フラグを \fIarg2\fP で渡された値に設定する。 \fBcapabilities\fP(7)  参照。
195 .TP 
196 \fBPR_GET_SECUREBITS\fP (Linux 2.6.26 以降)
197 呼び出したスレッドの "securebits" フラグを (関数の返り値として) 返す。 \fBcapabilities\fP(7)  参照。
198 .TP 
199 \fBPR_SET_TIMING\fP (Linux 2.6.0\-test4 以降)
200 .\" 0
201 .\" 1
202 .\" PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8,
203 .\" and looking at the patch history, it appears
204 .\" that it never did anything.
205 (通常の、伝統的に使われてきた) 統計的なプロセスタイミングを使用するか、
206 正確なタイムスタンプに基づくプロセスタイミングを使用するかを設定する。
207 \fIarg2\fP に指定できる値は \fBPR_TIMING_STATISTICAL\fP か
208 \fBPR_TIMING_TIMESTAMP\fP である。 \fBPR_TIMING_TIMESTAMP\fP は現在のところ実
209 装されていない (このモードに設定しようとするとエラー \fBEINVAL\fP が起こる
210 ことだろう)。
211 .TP 
212 \fBPR_GET_TIMING\fP (Linux 2.6.0\-test4 以降)
213 現在使用中のプロセスタイミングを決める方法を返す。
214 .TP 
215 \fBPR_TASK_PERF_EVENTS_DISABLE\fP (Linux 2.6.31 以降)
216 Disable all performance counters attached to the calling process, regardless
217 of whether the counters were created by this process or another process.
218 Performance counters created by the calling process for other processes are
219 unaffected.  For more information on performance counters, see the kernel
220 source file \fItools/perf/design.txt\fP.
221 .IP
222 .\" commit 1d1c7ddbfab358445a542715551301b7fc363e28
223 Originally called \fBPR_TASK_PERF_COUNTERS_DISABLE\fP; renamed (with same
224 numerical value)  in Linux 2.6.32.
225 .TP 
226 \fBPR_TASK_PERF_EVENTS_ENABLE\fP (Linux 2.6.31 以降)
227 The converse of \fBPR_TASK_PERF_EVENTS_DISABLE\fP; enable performance counters
228 attached to the calling process.
229 .IP
230 .\" commit 1d1c7ddbfab358445a542715551301b7fc363e28
231 .\" commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6
232 Originally called \fBPR_TASK_PERF_COUNTERS_ENABLE\fP; renamed in Linux 2.6.32.
233 .TP 
234 \fBPR_SET_TSC\fP (Linux 2.6.26 以降, x86 のみ)
235 そのプロセスがタイムスタンプ・カウンタを読み出せるかを決定する フラグの状態を設定する。 読み出しを許可する場合は \fIarg2\fP に
236 \fBPR_TSC_ENABLE\fP を、そのプロセスがタイムスタンプ・カウンタを読み出そうとした際に \fBSIGSEGV\fP を発生させる場合には
237 \fBPR_TSC_SIGSEGV\fP を渡す。
238 .TP 
239 \fBPR_GET_TSC\fP (Linux 2.6.26 以降, x86 のみ)
240 そのプロセスがタイムスタンプ・カウンタを読み出せるかを決定する フラグの状態を \fI(int\ *) arg2\fP が指す場所に格納して返す。
241 .TP 
242 \fBPR_SET_UNALIGN\fP
243 (ia64 では Linux 2.3.48 以降; parisc では Linux 2.6.15 以降; PowerPC では Linux 2.6.18
244 以降; Alpha では Linux 2.6.22 以降; これらのアーキテクチャのみ)  unaligned アクセス制御ビットを \fIarg2\fP
245 で指定された値に設定する。 指定できる値は \fBPR_UNALIGN_NOPRINT\fP (unaligned なユーザアクセスを黙って 修正する) か
246 \fBPR_UNALIGN_SIGBUS\fP (unaligned なユーザアクセスがあった場合 \fBSIGBUS\fP を生成する) である。
247 .TP 
248 \fBPR_GET_UNALIGN\fP
249 (バージョンとアーキテクチャの情報は \fBPR_SET_UNALIGN\fP 参照)  unaligned アクセス制御ビットの値を \fI(int\ *)
250 arg2\fP が指す場所に格納して返す。
251 .TP 
252 \fBPR_MCE_KILL\fP (Linux 2.6.32 以降)
253 Set the machine check memory corruption kill policy for the current thread.
254 If \fIarg2\fP is \fBPR_MCE_KILL_CLEAR\fP, clear the thread memory corruption kill
255 policy and use the system\-wide default.  (The system\-wide default is defined
256 by \fI/proc/sys/vm/memory_failure_early_kill\fP; see \fBproc\fP(5).)  If \fIarg2\fP
257 is \fBPR_MCE_KILL_SET\fP, use a thread\-specific memory corruption kill policy.
258 In this case, \fIarg3\fP defines whether the policy is \fIearly kill\fP
259 (\fBPR_MCE_KILL_EARLY\fP), \fIlate kill\fP (\fBPR_MCE_KILL_LATE\fP), or the
260 system\-wide default (\fBPR_MCE_KILL_DEFAULT\fP).  Early kill means that the
261 thread receives a \fBSIGBUS\fP signal as soon as hardware memory corruption is
262 detected inside its address space.  In late kill mode, the process is only
263 killed when it accesses a corrupted page.  See \fBsigaction\fP(2)  for more
264 information on the \fBSIGBUS\fP signal.  The policy is inherited by children.
265 The remaining unused \fBprctl\fP()  arguments must be zero for future
266 compatibility.
267 .TP 
268 \fBPR_MCE_KILL_GET\fP (Linux 2.6.32 以降)
269 Return the current per\-process machine check kill policy.  All unused
270 \fBprctl\fP()  arguments must be zero.
271 .TP 
272 \fBPR_SET_MM\fP (Linux 3.3 以降)
273 Modify certain kernel memory map descriptor fields of the calling process.
274 Usually these fields are set by the kernel and dynamic loader (see
275 \fBld.so\fP(8)  for more information) and a regular application should not use
276 this feature.  However, there are cases, such as self\-modifying programs,
277 where a program might find it useful to change its own memory map.  This
278 feature is available only if the kernel is built with the
279 \fBCONFIG_CHECKPOINT_RESTORE\fP option enabled.  The calling process must have
280 the \fBCAP_SYS_RESOURCE\fP capability.  The value in \fIarg2\fP is one of the
281 options below, while \fIarg3\fP provides a new value for the option.
282 .RS
283 .TP 
284 \fBPR_SET_MM_START_CODE\fP
285 Set the address above which the program text can run.  The corresponding
286 memory area must be readable and executable, but not writable or sharable
287 (see \fBmprotect\fP(2)  and \fBmmap\fP(2)  for more information).
288 .TP 
289 \fBPR_SET_MM_END_CODE\fP
290 Set the address below which the program text can run.  The corresponding
291 memory area must be readable and executable, but not writable or sharable.
292 .TP 
293 \fBPR_SET_MM_START_DATA\fP
294 Set the address above which initialized and uninitialized (bss) data are
295 placed.  The corresponding memory area must be readable and writable, but
296 not executable or sharable.
297 .TP 
298 \fBPR_SET_MM_END_DATA\fP
299 Set the address below which initialized and uninitialized (bss) data are
300 placed.  The corresponding memory area must be readable and writable, but
301 not executable or sharable.
302 .TP 
303 \fBPR_SET_MM_START_STACK\fP
304 Set the start address of the stack.  The corresponding memory area must be
305 readable and writable.
306 .TP 
307 \fBPR_SET_MM_START_BRK\fP
308 Set the address above which the program heap can be expanded with \fBbrk\fP(2)
309 call.  The address must be greater than the ending address of the current
310 program data segment.  In addition, the combined size of the resulting heap
311 and the size of the data segment can't exceed the \fBRLIMIT_DATA\fP resource
312 limit (see \fBsetrlimit\fP(2)).
313 .TP 
314 \fBPR_SET_MM_BRK\fP
315 .\" FIXME The following (until ========) is not yet in mainline kernel,
316 .\" so commented out for the moment.
317 .\" .TP
318 .\" .BR PR_SET_MM_ARG_START
319 .\" Set the address above which the program command line is placed.
320 .\" .TP
321 .\" .BR PR_SET_MM_ARG_END
322 .\" Set the address below which the program command line is placed.
323 .\" .TP
324 .\" .BR PR_SET_MM_ENV_START
325 .\" Set the address above which the program environment is placed.
326 .\" .TP
327 .\" .BR PR_SET_MM_ENV_END
328 .\" Set the address below which the program environment is placed.
329 .\" .IP
330 .\" The address passed with
331 .\" .BR PR_SET_MM_ARG_START ,
332 .\" .BR PR_SET_MM_ARG_END ,
333 .\" .BR PR_SET_MM_ENV_START ,
334 .\" and
335 .\" .BR PR_SET_MM_ENV_END
336 .\" should belong to a process stack area.
337 .\" Thus, the corresponding memory area must be readable, writable, and
338 .\" (depending on the kernel configuration) have the
339 .\" .BR MAP_GROWSDOWN
340 .\" attribute set (see
341 .\" .BR mmap (2)).
342 .\" .TP
343 .\" .BR PR_SET_MM_AUXV
344 .\" Set a new auxiliary vector.
345 .\" The
346 .\" .I arg3
347 .\" argument should provide the address of the vector.
348 .\" The
349 .\" .I arg4
350 .\" is the size of the vector.
351 .\" .TP
352 .\" .BR PR_SET_MM_EXE_FILE
353 .\" Supersede the
354 .\" .IR /proc/pid/exe
355 .\" symbolic link with a new one pointing to a new executable file
356 .\" identified by the file descriptor provided in
357 .\" .I arg3
358 .\" argument.
359 .\" The file descriptor should be obtained with a regular
360 .\" .BR open (2)
361 .\" call.
362 .\" .IP
363 .\" To change the symbolic link, one needs to unmap all existing
364 .\" executable memory areas, including those created by the kernel itself
365 .\" (for example the kernel usually creates at least one executable
366 .\" memory area for the ELF
367 .\" .IR .text
368 .\" section).
369 .\" .IP
370 .\" The second limitation is that such transitions can be done only once
371 .\" in a process life time.
372 .\" Any further attempts will be rejected.
373 .\" This should help system administrators to monitor unusual
374 .\" symbolic-link transitions over all process running in a system.
375 .\" ========== END FIXME
376 Set the current \fBbrk\fP(2)  value.  The requirements for the address are the
377 same as for the \fBPR_SET_MM_START_BRK\fP option.
378 .RE
379 .\"
380 .SH 返り値
381 成功すると、 \fBPR_GET_DUMPABLE\fP, \fBPR_GET_KEEPCAPS\fP,
382 \fBPR_CAPBSET_READ\fP, \fBPR_GET_TIMING\fP, \fBPR_GET_SECUREBITS\fP,
383 \fBPR_MCE_KILL_GET\fP, \fBPR_GET_SECCOMP\fP は上述の負でない値を返す (なお、
384 \fBPR_GET_SECCOMP\fP は返らない場合もある)。 \fIoption\fP が他の値の場合は
385 成功時に 0 を返す。
386 エラーの場合、\-1 を返し、 \fIerrno\fP に適切な値を設定する。
387 .SH エラー
388 .TP 
389 \fBEFAULT\fP
390 \fIarg2\fP が不正なアドレスである。
391 .TP 
392 \fBEINVAL\fP
393 \fIoption\fP の値が理解できない。
394 .TP 
395 \fBEINVAL\fP
396 \fIoption\fP is \fBPR_MCE_KILL\fP or \fBPR_MCE_KILL_GET\fP or \fBPR_SET_MM\fP, and
397 unused \fBprctl\fP()  arguments were not specified as zero.
398 .TP 
399 \fBEINVAL\fP
400 \fIarg2\fP が指定された \fIoption\fP で有効な値ではない。
401 .TP 
402 \fBEINVAL\fP
403 \fIoption\fP が \fBPR_SET_SECCOMP\fP か \fBPR_GET_SECCOMP\fP だが、カーネルが \fBCONFIG_SECCOMP\fP
404 を有効にして作成されていなかった。
405 .TP 
406 \fBEINVAL\fP
407 \fIoption\fP is \fBPR_SET_MM\fP, and one of the following is true
408 .RS
409 .IP * 3
410 \fIarg4\fP or \fIarg5\fP is nonzero;
411 .IP *
412 \fIarg3\fP is greater than \fBTASK_SIZE\fP (the limit on the size of the user
413 address space for this architecture);
414 .IP *
415 \fIarg2\fP is \fBPR_SET_MM_START_CODE\fP, \fBPR_SET_MM_END_CODE\fP,
416 \fBPR_SET_MM_START_DATA\fP, \fBPR_SET_MM_END_DATA\fP, or \fBPR_SET_MM_START_STACK,\fP
417 and the permissions of the corresponding memory area are not as required;
418 .IP *
419 \fIarg2\fP is \fBPR_SET_MM_START_BRK\fP or \fBPR_SET_MM_BRK\fP, and \fIarg3\fP is less
420 than or equal to the end of the data segment or specifies a value that would
421 cause the \fBRLIMIT_DATA\fP resource limit to be exceeded.
422 .RE
423 .TP 
424 \fBEPERM\fP
425 \fIoption\fP が \fBPR_SET_SECUREBITS\fP で、呼び出し元がケーパビリティ \fBCAP_SETPCAP\fP を持っていない。
426 または、"locked" フラグを解除しようとした。 または、locked フラグがセットされているフラグをセットしようとした
427 (\fBcapabilities\fP(7)  参照)。
428 .TP 
429 \fBEPERM\fP
430 \fIoption\fP が \fBPR_SET_KEEPCAPS\fP で、呼び出し元のフラグ \fBSECURE_KEEP_CAPS_LOCKED\fP
431 がセットされている (\fBcapabilities\fP(7)  参照)。
432 .TP 
433 \fBEPERM\fP
434 \fIoption\fP が \fBPR_CAPBSET_DROP\fP で、呼び出し元がケーパビリティ \fBCAP_SETPCAP\fP を持っていない。
435 .TP 
436 \fBEPERM\fP
437 .\" FIXME The following (until ========) is not yet in mainline kernel,
438 .\" so commented out for the moment.
439 .\" .TP
440 .\" .B EACCES
441 .\" .I option
442 .\" is
443 .\" .BR PR_SET_MM ,
444 .\" and
445 .\" .I arg3
446 .\" is
447 .\" .BR PR_SET_MM_EXE_FILE ,
448 .\" the file is not executable.
449 .\" .TP
450 .\" .B EBUSY
451 .\" .I option
452 .\" is
453 .\" .BR PR_SET_MM ,
454 .\" .I arg3
455 .\" is
456 .\" .BR PR_SET_MM_EXE_FILE ,
457 .\" and this the second attempt to change the
458 .\" .I /proc/pid/exe
459 .\" symbolic link, which is prohibited.
460 .\" .TP
461 .\" .B EBADF
462 .\" .I option
463 .\" is
464 .\" .BR PR_SET_MM ,
465 .\" .I arg3
466 .\" is
467 .\" .BR PR_SET_MM_EXE_FILE ,
468 .\" and the file descriptor passed in
469 .\" .I arg4
470 .\" is not valid.
471 .\" ========== END FIXME
472 .\" The following can't actually happen, because prctl() in
473 .\" seccomp mode will cause SIGKILL.
474 .\" .TP
475 .\" .B EPERM
476 .\" .I option
477 .\" is
478 .\" .BR PR_SET_SECCOMP ,
479 .\" and secure computing mode is already 1.
480 \fIoption\fP が \fBPR_SET_MM\fP で、呼び出し元がケーパビリティ
481 \fBCAP_SYS_RESOURCE\fP を持っていない。
482 .SH バージョン
483 .\" The library interface was added in glibc 2.0.6
484 \fBprctl\fP()  システムコールは Linux 2.1.57 で導入された。
485 .SH 準拠
486 このコールは Linux 特有である。 IRIX には \fBprctl\fP()  システム・コールがあるが (MIPS アーキテクチャにおいて
487 irix_prctl として Linux 2.1.44 で同様に導入された)、 そのプロトタイプは
488 .sp
489 \fBptrdiff_t prctl(int \fP\fIoption\fP\fB, int \fP\fIarg2\fP\fB, int \fP\fIarg3\fP\fB);\fP
490 .sp
491 である。ユーザー当りのプロセス最大数を取得するオプション、 プロセスの使用できる最大プロッサー数を取得するオプション、
492 現在特定のプロセスが停止(block)させられているかどうか調べるオプション、 スタックサイズの最大値の取得や設定を行なうオプションなどがある。
493 .SH 関連項目
494 \fBsignal\fP(2), \fBcore\fP(5)
495 .SH この文書について
496 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
497 である。プロジェクトの説明とバグ報告に関する情報は
498 http://www.kernel.org/doc/man\-pages/ に書かれている。