On Sunday 02 June 2013 14:46:13 Dag Wieers wrote:
> BTW I don't see why we do COMM_LEN + 1 in the non-threaded name. Isn't the
> process name always limited to 15 characters (plus null-termination) ?

yes, the kernel currently does this:
linux/fs/exec.c:
        setup_new_exec(): set_task_comm(current, bprm->tcomm);
        set_task_comm(): strlcpy(tsk->comm, buf, sizeof(tsk->comm));

but the kernel writes out 16 bytes in the proc name:
linux/fs/proc/base.c:
        REG("comm",      S_IRUGO|S_IWUSR, proc_pid_set_comm_operations),
        proc_pid_set_comm_operations{}.open: comm_open()
        comm_open(): single_open(filp, comm_show, inode);
        comm_show(): seq_printf(m, "%s\n", p->comm);

i think this is just us coding defensively.  or not.  who knows :).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to