Topic title longer than 15 characters?

Using functions such as prctl or pthread_set_name_np, you can change the name of the thread. The limitation that both functions impose, at least in Linux 2.6.38, is that the name cannot be longer than 15 characters (the NULL ending is the 16th byte).

Where is this 15-digit limit, and is there any (even unorthodox) way around it?

Update

As mentioned in the comments, this is overlaid by the kernel.

The definition can be found here: http://lxr.linux.no/linux+v2.6.37/include/linux/sched.h#L245

+10
c linux unix pthreads introspection
Feb 17 2018-11-11T00:
source share
2 answers

15- char limit is executed by the kernel.

struct task_struct :: comm [TASK_COMM_LEN], which has a width of 16 bytes.

You need to recompile the kernel if you want to increase it.

+12
Feb 17 '11 at 9:17
source share

Although the kernel has a restriction on the normal task name, you can change the command line parameters (as shown in ps ) by overwriting the memory pointed to by argv[0] . This can be used to display additional data up to one page in size.

0
Feb 17 '11 at 11:43
source share



All Articles