[Bash-completion-devel] "procfs stores process name in a truncated form in /proc/<pid>/stat"

Ben Hutchings ben at decadent.org.uk
Sun May 31 21:47:42 UTC 2009

David Paleino wrote:
> while fixing #497540 we stumbled upon a bug in procps. Trying to fix completion
> for "killall", we wanted to use "ps axo comm" instead of "ps axo command", but
> that truncates process names at 15 characters. It could've been a procps bug,
> but the truncated form is really stored in /proc/<pid>/stat:
> Is there a reason for this 15-characters-limitation?

The in-kernel process name is limited to 16 bytes (including null
terminator), and this is unlikely to be changed.  Therefore I will
reassign this back to bash-completion.  You need to look at how killall
matches commands and replicate that.  It is probably reading the full
command line (/proc/*/cmdline) and taking the basename of the first


Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20090531/1391284d/attachment.pgp>

More information about the Bash-completion-devel mailing list