On Mon, 5 Sep 2011 21:38:01 +0300Thanks for a comment. Your objections are quite clear, and I don't like this solution as well, but eventually having that value in userspace is really desirable. However in assumption that this value is preserved fixed and won't be changed in reasonable perspective, the presented approach becomes the most evident and simple.
Vladimir Zapolskiy<vz@xxxxxxxxx> wrote:
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.
I'm sorry but I don't like doing this.
The moment we do this, we never can increase it anymore since userspace
might be using it for its own uses and we'd break it if we changed
this value.
Let's do it in a proper way. What's the common practice to export such limit values? I suppose via /proc/sys/kernel, please correct me, if I'm wrong.
If we need to export this, we should export it in /proc or /sys
somewhere as a dynamic value.....