Skip to contentSkip to conversation

absolute path of a process

DISCUSSION Senhua Tao 3 participants 3 messages Jan 9, 2002

lore
Share & tools
lore

Senhua Tao

author
#0 lore raw

Hi,

I am new to linux kernel. I like to know is there any way to find
the absolute path of a process. I mean, how the kernel knows which process is currently running? I tried to follow the current variable but got lost. Is the inode struct should I look at?

Thanks.

Sen Tao

#1 lore raw
Quoted 6 lines · * Senhua Tao ([email protected]) wrote:

Hi,

I am new to linux kernel. I like to know is there any way to find
the absolute path of a process. I mean, how the kernel knows which process is currently running? I tried to follow the current variable but got lost. Is the inode struct should I look at?

look at the code in fs/proc/base.c::proc_exe_link(), that should explain it.

cheers,
-chris

#2 lore raw
In reply to Senhua Tao
Followup to:  <[email protected]>
By author:    Senhua Tao <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 8 lines

Hi,

I am new to linux kernel. I like to know is there any way to find
the absolute path of a process. I mean, how the kernel knows which process is currently running? I tried to follow the current variable but got lost. Is the inode struct should I look at?

Examine /proc/self/exe.

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<[email protected]>