task struct and the #! operator

Ranjan Sinha rnjn.sinha at gmail.com
Wed May 30 16:05:24 EDT 2012


Hi,

I am trying to understand process creation and associated
bookkeeping.I am currently trying to understand how interpreted
scripts (the shebang operator) are executed.

It was surprising to see that the comm member of task_struct (accessed
through get_task_comm) is actually set to the name of the script
though /proc/pid/exe correctly points to the invoked interpreter. Does
anybody know where the necessary magic happen and is it possible to
get the name of invoked interpreter through any means inside the
kernel?

Thanks in advance,
Ranjan



More information about the Kernelnewbies mailing list