task struct and the #! operator

Vladimir Murzin murzin.v at gmail.com
Thu May 31 00:51:43 EDT 2012


Hi,

Have a look at binfmt_script.c [1] $)

[1] http://lxr.free-electrons.com/source/fs/binfmt_script.c

Best wishes
Vladimir Murzin

On 5/31/12, Ranjan Sinha <rnjn.sinha at gmail.com> wrote:
> 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
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



More information about the Kernelnewbies mailing list