* [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME
@ 2014-10-21 10:58 Andreas Schwab
[not found] ` <mvmr3y1u1t8.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2014-10-21 10:58 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
The size of the process name has always been at most 16 byte _including_
the null terminator. This also means that the name returned by
PR_GET_NAME is always null-terminated.
Signed-off-by: Andreas Schwab <schwab-l3A5Bk7waGM@public.gmane.org>
---
man2/prctl.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man2/prctl.2 b/man2/prctl.2
index 1199891..4351ff9 100644
--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -240,7 +240,7 @@ using the value in the location pointed to by
.IR "(char\ *) arg2" .
The name can be up to 16 bytes long,
.\" TASK_COMM_LEN in include/linux/sched.h
-and should be null-terminated if it contains fewer bytes.
+including the terminating null byte.
This is the same attribute that can be set via
.BR pthread_setname_np (3)
and retrieved using
@@ -256,7 +256,7 @@ 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 if it is shorter than that.
+the returned string will be null-terminated.
.TP
.BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)"
Set the calling process's
--
2.1.2
--
Andreas Schwab, SUSE Labs, schwab-l3A5Bk7waGM@public.gmane.org
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <mvmr3y1u1t8.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org>]
* Re: [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME [not found] ` <mvmr3y1u1t8.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org> @ 2014-10-28 13:26 ` Michael Kerrisk (man-pages) [not found] ` <544F9996.7090906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Michael Kerrisk (man-pages) @ 2014-10-28 13:26 UTC (permalink / raw) To: Andreas Schwab Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA Hello Andreas, On 10/21/2014 12:58 PM, Andreas Schwab wrote: > The size of the process name has always been at most 16 byte _including_ > the null terminator. This also means that the name returned by > PR_GET_NAME is always null-terminated. Thanks. I applied this. One comment below. > Signed-off-by: Andreas Schwab <schwab-l3A5Bk7waGM@public.gmane.org> > --- > man2/prctl.2 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/man2/prctl.2 b/man2/prctl.2 > index 1199891..4351ff9 100644 > --- a/man2/prctl.2 > +++ b/man2/prctl.2 > @@ -240,7 +240,7 @@ using the value in the location pointed to by > .IR "(char\ *) arg2" . > The name can be up to 16 bytes long, > .\" TASK_COMM_LEN in include/linux/sched.h > -and should be null-terminated if it contains fewer bytes. > +including the terminating null byte. I added here: (If the length of the string, including the terminating null byte, exceeds 16 bytes, the string is silently truncated.) Okay? Cheers, Michael > This is the same attribute that can be set via > .BR pthread_setname_np (3) > and retrieved using > @@ -256,7 +256,7 @@ 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 if it is shorter than that. > +the returned string will be null-terminated. > .TP > .BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)" > Set the calling process's > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <544F9996.7090906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME [not found] ` <544F9996.7090906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2014-10-28 14:05 ` Andreas Schwab [not found] ` <mvmk33kmgrc.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Andreas Schwab @ 2014-10-28 14:05 UTC (permalink / raw) To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > I added here: > > (If the length of the string, including the terminating null byte, > exceeds 16 bytes, the string is silently truncated.) > > Okay? Ok. Andreas. -- Andreas Schwab, SUSE Labs, schwab-l3A5Bk7waGM@public.gmane.org GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <mvmk33kmgrc.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org>]
* Re: [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME [not found] ` <mvmk33kmgrc.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org> @ 2014-10-28 14:08 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 5+ messages in thread From: Michael Kerrisk (man-pages) @ 2014-10-28 14:08 UTC (permalink / raw) To: Andreas Schwab; +Cc: linux-man On Tue, Oct 28, 2014 at 3:05 PM, Andreas Schwab <schwab-l3A5Bk7waGM@public.gmane.org> wrote: > "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > >> I added here: >> >> (If the length of the string, including the terminating null byte, >> exceeds 16 bytes, the string is silently truncated.) >> >> Okay? > > Ok. Thanks for the confirmation, Andreas. Cheers, Michael -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME @ 2014-10-14 9:12 Andreas Schwab 0 siblings, 0 replies; 5+ messages in thread From: Andreas Schwab @ 2014-10-14 9:12 UTC (permalink / raw) To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA The size of the process name has always been at most 16 byte _including_ the null terminator. This also means that the name returned by PR_GET_NAME is always null-terminated. Signed-off-by: Andreas Schwab <schwab-l3A5Bk7waGM@public.gmane.org> --- man2/prctl.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man2/prctl.2 b/man2/prctl.2 index 1199891..4351ff9 100644 --- a/man2/prctl.2 +++ b/man2/prctl.2 @@ -240,7 +240,7 @@ using the value in the location pointed to by .IR "(char\ *) arg2" . The name can be up to 16 bytes long, .\" TASK_COMM_LEN in include/linux/sched.h -and should be null-terminated if it contains fewer bytes. +including the terminating null byte. This is the same attribute that can be set via .BR pthread_setname_np (3) and retrieved using @@ -256,7 +256,7 @@ 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 if it is shorter than that. +the returned string will be null-terminated. .TP .BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)" Set the calling process's -- 2.1.2 -- Andreas Schwab, SUSE Labs, schwab-l3A5Bk7waGM@public.gmane.org GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-28 14:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-21 10:58 [PATCH] prctl.2: Correct description of null-termination in PR_[GS]ET_NAME Andreas Schwab
[not found] ` <mvmr3y1u1t8.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org>
2014-10-28 13:26 ` Michael Kerrisk (man-pages)
[not found] ` <544F9996.7090906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-28 14:05 ` Andreas Schwab
[not found] ` <mvmk33kmgrc.fsf-8jEJWzg51KSXcDkGTvBoYw@public.gmane.org>
2014-10-28 14:08 ` Michael Kerrisk (man-pages)
-- strict thread matches above, loose matches on Subject: below --
2014-10-14 9:12 Andreas Schwab
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.