Welcome! Log In Create A New Profile


TASK_COMM_LEN #define in the linux kernel

Posted by Panos 
Hello newbies!

In linux/include/trace/events/sched.h you can find the macro:

#define TASK_COMM_LEN 16

This macro is used to define the field comm of struct task_struct. What happens if the process name is bigger than 16 characters? Does the kernel just ignore the rest of the name? Is it possible to recover the full process name (if it's more than 16 characters) in kernel space?

Thanks in advance,
Re: TASK_COMM_LEN #define in the linux kernel
September 30, 2017 10:40AM
If process name is bigger than 16 character than it skips rest of the characters.

Try with some different value of TASK_COMM_LEN (say 12) and recompile and reinstall the kernel and you will find the difference.

Edited 1 time(s). Last edit at 09/30/2017 10:41AM by shyam.

Your Email:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 3 plus 4?