Linux Documentation
 help / color / mirror / Atom feed
* [PATCH] docs: proc.rst: comm: mention the included NUL
@ 2024-02-05 15:41 Christoph Anton Mitterer
  2024-02-06  2:22 ` [PATCH v2 0/1] " Christoph Anton Mitterer
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Anton Mitterer @ 2024-02-05 15:41 UTC (permalink / raw)
  To: linux-doc; +Cc: corbet

Indicate that the actual value will be one character less.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
---
 Documentation/filesystems/proc.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 104c6d047d9b..41b9be923519 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -1899,8 +1899,8 @@ For more information on mount propagation see:
 These files provide a method to access a task's comm value. It also allows for
 a task to set its own or one of its thread siblings comm value. The comm value
 is limited in size compared to the cmdline value, so writing anything longer
-then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
-comm value.
+then the kernel's TASK_COMM_LEN (currently 16 chars, including the null
+terminator) will result in a truncated comm value.
 
 
 3.7	/proc/<pid>/task/<tid>/children - Information about task children
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 0/1] docs: proc.rst: comm: mention the included NUL
  2024-02-05 15:41 [PATCH] docs: proc.rst: comm: mention the included NUL Christoph Anton Mitterer
@ 2024-02-06  2:22 ` Christoph Anton Mitterer
  2024-02-06  2:22   ` [PATCH v2 1/1] " Christoph Anton Mitterer
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Anton Mitterer @ 2024-02-06  2:22 UTC (permalink / raw)
  To: linux-doc; +Cc: corbet

Hey.

V1 of the patch explained matters purely from `TASK_COMM_LEN`’s PoV, where the
last character is the null terminator.

But the documentation is more about the file `comm`, where the last character is
a LF character.


V2: Addresses the above by also explaining that the null terminator is printed
    as LF in the file.


Choose whichever of the two you prefer, I don't mind.

Thanks,
Chris.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/1] docs: proc.rst: comm: mention the included NUL
  2024-02-06  2:22 ` [PATCH v2 0/1] " Christoph Anton Mitterer
@ 2024-02-06  2:22   ` Christoph Anton Mitterer
  2024-02-08 22:47     ` Jonathan Corbet
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Anton Mitterer @ 2024-02-06  2:22 UTC (permalink / raw)
  To: linux-doc; +Cc: corbet

Indicate that the actual value will be one character less.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
---
 Documentation/filesystems/proc.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 104c6d047d9b..c0e92a056079 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -1899,8 +1899,9 @@ For more information on mount propagation see:
 These files provide a method to access a task's comm value. It also allows for
 a task to set its own or one of its thread siblings comm value. The comm value
 is limited in size compared to the cmdline value, so writing anything longer
-then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
-comm value.
+then the kernel's TASK_COMM_LEN (currently 16 chars, including the null
+terminator, which is printed as the line feed character in the file) will result
+in a truncated comm value.
 
 
 3.7	/proc/<pid>/task/<tid>/children - Information about task children
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] docs: proc.rst: comm: mention the included NUL
  2024-02-06  2:22   ` [PATCH v2 1/1] " Christoph Anton Mitterer
@ 2024-02-08 22:47     ` Jonathan Corbet
  2024-02-08 22:58       ` Christoph Anton Mitterer
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2024-02-08 22:47 UTC (permalink / raw)
  To: Christoph Anton Mitterer, linux-doc

Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> writes:

> Indicate that the actual value will be one character less.
>
> Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
> ---
>  Documentation/filesystems/proc.rst | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index 104c6d047d9b..c0e92a056079 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -1899,8 +1899,9 @@ For more information on mount propagation see:
>  These files provide a method to access a task's comm value. It also allows for
>  a task to set its own or one of its thread siblings comm value. The comm value
>  is limited in size compared to the cmdline value, so writing anything longer
> -then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
> -comm value.
> +then the kernel's TASK_COMM_LEN (currently 16 chars, including the null
> +terminator, which is printed as the line feed character in the file) will result
> +in a truncated comm value.

I don't understand the line-feed comment at all; printed by whom?

I think I'll just apply the first version, which explained the situation
well enough.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] docs: proc.rst: comm: mention the included NUL
  2024-02-08 22:47     ` Jonathan Corbet
@ 2024-02-08 22:58       ` Christoph Anton Mitterer
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Anton Mitterer @ 2024-02-08 22:58 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc

On Thu, 2024-02-08 at 15:47 -0700, Jonathan Corbet wrote:
> I don't understand the line-feed comment at all; printed by whom?

I mean when reading the file /proc/.../comm, then the string seems to
have a trailing newline (LF).

Perhaps something like "provided" or "given" would have been a better
word, but not really perfect either.
And "written" or "stored" would have also been wrong IMO.


> I think I'll just apply the first version, which explained the
> situation
> well enough.

I'd also think it's enough, which is why I had even written, that you
may pick whichever you like better.


Thanks,
Chris.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-09  1:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 15:41 [PATCH] docs: proc.rst: comm: mention the included NUL Christoph Anton Mitterer
2024-02-06  2:22 ` [PATCH v2 0/1] " Christoph Anton Mitterer
2024-02-06  2:22   ` [PATCH v2 1/1] " Christoph Anton Mitterer
2024-02-08 22:47     ` Jonathan Corbet
2024-02-08 22:58       ` Christoph Anton Mitterer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox