Re: Finding process' argv from task_struct

From: Jes Sorensen (Jes.Sorensen@cern.ch)
Date: Sun Mar 26 2000 - 07:56:00 EST


>>>>> "Krisztian" == Krisztian Flautner <manowar@engin.umich.edu> writes:

Krisztian> Thanks for the reply for my previous message. I should have
Krisztian> been clearer: I would like to find out the command line of
Krisztian> the program given a pointer to its task_struct. argv[0]
Krisztian> should be enough but the rest would not hurt either. How
Krisztian> do I do this?

It gets stuffed onto the stack at process creation time, see
fs/binfmt_elf.c, however once the application has started running
there is little you can do to get it back, in particular as glibc will
modify it on certain architectures.

Passing user space command lines from within the kernel is *really*
not something one should consider doing.

Jes

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:17 EST