mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] sched: share task comm length value to userspace
Date: Mon,  5 Sep 2011 21:38:01 +0300	[thread overview]
Message-ID: <1315247881-31597-1-git-send-email-vz@mleia.com> (raw)

This change allows to get a defined length of task comm in
userspace. For a moment this value is implied at least in two cases:
* max length of comm value got from /proc/$pid/stat
* max string length argument of prctl(PR_[SG]ET_NAME, ...)

For these reasons it becomes desirable to impart task comm max length
value to userspace.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 include/linux/sched.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4ac2c05..21d300b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -42,6 +42,9 @@
 /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
 #define SCHED_RESET_ON_FORK     0x40000000
 
+/* Task command name length */
+#define TASK_COMM_LEN 16
+
 #ifdef __KERNEL__
 
 struct sched_param {
@@ -242,9 +245,6 @@ extern char ___assert_task_state[1 - 2*!!(
 #define set_current_state(state_value)		\
 	set_mb(current->state, (state_value))
 
-/* Task command name length */
-#define TASK_COMM_LEN 16
-
 #include <linux/spinlock.h>
 
 /*
-- 
1.7.5.4


             reply	other threads:[~2011-09-05 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 18:38 Vladimir Zapolskiy [this message]
2011-09-05 19:47 ` Arjan van de Ven
2011-09-05 20:17   ` Vladimir Zapolskiy
2011-09-05 20:39     ` Arjan van de Ven
2011-09-09 23:41       ` Andrew Morton
2011-09-09 23:49         ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315247881-31597-1-git-send-email-vz@mleia.com \
    --to=vz@mleia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®