Re: Get the full path of the current process?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can check how proc does it - proc has a symlink for each executable.
For example, if the pid is 123, /proc/123/exe is a symlink to the file
that was executed.  See how proc creates this symlink and you have your
answer.

Avishay

On Sat, 2005-12-31 at 10:47 +0900, NAHieu wrote:
> Hello,
> 
> I want to get the full path of the current process (using current
> pointer, in kernel 2.6.14). It seems that the best way is to use
> d_path(). But d_path() requires a *dentry* of the executable binary,
> and I dont know where to get that dentry.
> 
> Anybody please tell me how to get it?
> 
> Many thanks.
> Hieu
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux