On 05/17/2018 12:09 AM, Andy Lutomirski wrote: > On Wed, May 16, 2018 at 7:59 PM Linus Torvalds < > torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > >> Tha fact is, "comm[]" is not that, and simply never will be. It is just > the >> basename of the executable, and even then it's truncated. Maybe it's >> truncated to 16 bytes, maybe it might some day be truncated to a slightly >> larger number, but it will never be what /proc/<pid>/cmdline people want. > > I just checked. My Real Work (tm) code has been using PR_SET_NAME to set a > short description of which microservice [1] lived in which process. 32 or > 64 bytes would be nicer, since 16 bytes has a tendency to truncate the name. I agree. I think a slightly wider comm[] would be nicer. I think 64-bytes would certainly allow a process to encode a useful amount of state. I figure we might reliably detect truncation in userspace, and then return ERANGE via pthread_setname_np, or via a new API. It could work. I can do the glibc parts, and cleanup the linux man pages on this topic. -- Cheers, Carlos. -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html