]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ps(1): Fix formatting of the "command" field for kernel threads.
authorMark Johnston <markj@FreeBSD.org>
Tue, 28 Jul 2020 15:26:19 +0000 (15:26 +0000)
committerMark Johnston <markj@FreeBSD.org>
Tue, 28 Jul 2020 15:26:19 +0000 (15:26 +0000)
commitc7f893a42b9572f1152d163290202b855953a768
treeb4cff4c4a8b225a2498ddcf36f0c032c79dcc1db
parentce69217c7b8f81e5bcdf1337ceb729100acf8747
ps(1): Fix formatting of the "command" field for kernel threads.

When -H is specified, for kernel threads the command is formatted as
"<proc name>/<td name>" and truncated to MAXCOMLEN.  But each of the
proc name and td name may be up to MAXCOMLEN bytes in length.

Also handle the ki_moretdname field to ensure that the full thread name
gets printed.  This is already handled correctly when formatting for
"-o tdname".

Reported by: freqlabs
Reviewed by: freqlabs
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25840
bin/ps/ps.c