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