aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-05-29 17:05:18 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-31 01:47:22 +0200
commit7bf365268357df64aced4ed87be2a3b5f42ba8aa (patch)
tree39d63a6bc255072775de1ca0f5ad48e4337ae540
parenta4fc951083633c95c6b8351c50045478bec2f371 (diff)
downloadman-pages-7bf365268357df64aced4ed87be2a3b5f42ba8aa.tar.gz
PR_SET_NAME.2const: Tweak after split
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2const/PR_SET_NAME.2const60
1 files changed, 35 insertions, 25 deletions
diff --git a/man/man2const/PR_SET_NAME.2const b/man/man2const/PR_SET_NAME.2const
index ae2d97243d..1e9c26a243 100644
--- a/man/man2const/PR_SET_NAME.2const
+++ b/man/man2const/PR_SET_NAME.2const
@@ -4,9 +4,6 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.\" Modified 2006-08-30 Guillem Jover <guillem@hadrons.org>
-.\" Added PR_SET_NAME, PR_GET_NAME,
-.\"
.TH PR_SET_NAME 2const (date) "Linux man-pages (unreleased)"
.SH NAME
PR_SET_NAME,
@@ -20,38 +17,32 @@ Standard C library
.nf
.B #include <sys/prctl.h>
.P
-.BI "int prctl(int " op ", ...);"
+.BI "int prctl(PR_SET_NAME, char " name "[16], 0L, 0L, 0L);"
+.BI "int prctl(PR_GET_NAME, const char " name "[16], 0L, 0L, 0L);"
.fi
.SH DESCRIPTION
.TP
-.BR PR_SET_NAME " (since Linux 2.6.9)"
+.B PR_SET_NAME
Set the name of the calling thread,
using the value in the location pointed to by
-.IR "(char\~*) arg2" .
+.IR name .
+.IP
The name can be up to 16 bytes long,
.\" TASK_COMM_LEN in include/linux/sched.h
including the terminating null byte.
-(If the length of the string, including the terminating null byte,
-exceeds 16 bytes, the string is silently truncated.)
-This is the same attribute that can be set via
-.BR pthread_setname_np (3)
-and retrieved using
-.BR pthread_getname_np (3).
-The attribute is likewise accessible via
-.IR /proc/self/task/ tid /comm
-(see
-.BR proc (5)),
-where
-.I tid
-is the thread ID of the calling thread, as returned by
-.BR gettid (2).
+If the length of the string, including the terminating null byte,
+exceeds 16 bytes, the string is silently truncated.
.TP
.BR PR_GET_NAME " (since Linux 2.6.11)"
Return the name of the calling thread,
in the buffer pointed to by
-.IR "(char\~*) arg2" .
-The buffer should allow space for up to 16 bytes;
-the returned string will be null-terminated.
+.IR name .
+The returned string will be null-terminated.
+.P
+This is the same attribute that can be set via
+.BR pthread_setname_np (3)
+and retrieved using
+.BR pthread_getname_np (3).
.SH RETURN VALUE
On success,
0 is returned.
@@ -61,10 +52,29 @@ is set to indicate the error.
.SH ERRORS
.TP
.B EFAULT
-.I arg2
+.I name
is an invalid address.
+.SH FILES
+.TP
+.IR /proc/self/task/\: tid /\:comm
+The attribute is likewise accessible via this file
+(see
+.BR proc_pid_comm (5)),
+where
+.I tid
+is the thread ID of the calling thread, as returned by
+.BR gettid (2).
.SH STANDARDS
Linux.
.SH HISTORY
+.TP
+.B PR_SET_NAME
+Linux 2.6.9.
+.TP
+.B PR_GET_NAME
+Linux 2.6.11.
.SH SEE ALSO
-.BR prctl (2)
+.BR prctl (2),
+.BR pthread_setname_np (3),
+.BR pthread_getname_np (3),
+.BR proc_pid_comm (5)