OSDN Git Service

(split) LDP: Update original to LDP v3.63
[linuxjm/LDP_man-pages.git] / original / man2 / prctl.2
index c818260..487232e 100644 (file)
@@ -49,7 +49,7 @@
 .\" 2012-02-04 Michael kerrisk, document PR_{SET,GET}_CHILD_SUBREAPER
 .\"
 .\"
-.TH PRCTL 2 2013-05-21 "Linux" "Linux Programmer's Manual"
+.TH PRCTL 2 2014-02-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 prctl \- operations on a process
 .SH SYNOPSIS
@@ -285,7 +285,7 @@ For more information, see the kernel source file
 .IR Documentation/prctl/no_new_privs.txt .
 .TP
 .BR PR_GET_NO_NEW_PRIVS " (since Linux 3.5)"
-Return the value of the
+Return (as the function result) the value of the
 .I no_new_privs
 bit for the current process.
 A value of 0 indicates the regular
@@ -305,6 +305,8 @@ This value is cleared for the child of a
 .BR fork (2)
 and (since Linux 2.4.36 / 2.6.23)
 when executing a set-user-ID or set-group-ID binary.
+This value is preserved across
+.BR execve (2).
 .TP
 .BR PR_GET_PDEATHSIG " (since Linux 2.3.15)"
 Return the current value of the parent process death signal,
@@ -332,7 +334,7 @@ set to 0 clears the caller's "ptracer process ID".
 If
 .I arg2
 is
-.BR PR_SET_PTRACER_ANY,
+.BR PR_SET_PTRACER_ANY ,
 the ptrace restrictions introduced by Yama are effectively disabled for the
 calling process.
 
@@ -405,7 +407,8 @@ For further information, see the kernel source file
 .IR Documentation/prctl/seccomp_filter.txt .
 .TP
 .BR PR_GET_SECCOMP " (since Linux 2.6.23)"
-Return the secure computing mode of the calling thread.
+Return (as the function result)
+the secure computing mode of the calling thread.
 If the caller is not in secure computing mode, this operation returns 0;
 if the caller is in strict secure computing mode, then the
 .BR prctl ()
@@ -486,7 +489,7 @@ and
 .BR sem_timedwait (3)).
 
 Timer slack is not applied to threads that are scheduled under
-a realtime scheduling policy (see
+a real-time scheduling policy (see
 .BR sched_setscheduler (2)).
 
 Each thread has two associated timer slack values:
@@ -507,7 +510,8 @@ The timer slack values are preserved across
 .BR execve (2).
 .TP
 .BR PR_GET_TIMERSLACK " (since Linux 2.6.28)"
-Return the current timer slack value of the calling thread.
+Return (as the function result)
+the current timer slack value of the calling thread.
 .TP
 .BR PR_SET_TIMING " (since Linux 2.6.0-test4)"
 Set whether to use (normal, traditional) statistical process timing or
@@ -640,6 +644,7 @@ All unused
 arguments must be zero.
 .TP
 .BR PR_SET_MM " (since Linux 3.3)"
+.\" commit 028ee4be34a09a6d48bdf30ab991ae933a7bc036
 Modify certain kernel memory map descriptor fields
 of the calling process.
 Usually these fields are set by the kernel and dynamic loader (see
@@ -709,67 +714,68 @@ value.
 The requirements for the address are the same as for the
 .BR PR_SET_MM_START_BRK
 option.
-.\" 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
+.P
+The following options are available since Linux 3.5.
+.\" commit fe8c7f5cbf91124987106faa3bdf0c8b955c4cf7
+.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
+.\" commit b32dfe377102ce668775f8b6b1461f7ad428f8b6
+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 monitor unusual
+symbolic-link transitions over all processes running on a system.
 .RE
 .\"
 .SH RETURN VALUE
@@ -779,6 +785,7 @@ On success,
 .BR PR_GET_NO_NEW_PRIVS ,
 .BR PR_CAPBSET_READ ,
 .BR PR_GET_TIMING ,
+.BR PR_GET_TIMERSLACK ,
 .BR PR_GET_SECUREBITS ,
 .BR PR_MCE_KILL_GET ,
 and (if it returns)
@@ -851,7 +858,7 @@ is
 .BR PR_SET_MM_START_DATA ,
 .BR PR_SET_MM_END_DATA ,
 or
-.BR PR_SET_MM_START_STACK,
+.BR PR_SET_MM_START_STACK ,
 and the permissions of the corresponding memory area are not as required;
 .IP *
 .I arg2
@@ -914,41 +921,38 @@ is
 and the caller does not have the
 .B CAP_SYS_RESOURCE
 capability.
-.\" 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
+.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.
 .\" The following can't actually happen, because prctl() in
 .\" seccomp mode will cause SIGKILL.
 .\" .TP