Operating System - HP-UX
1753435 Members
4600 Online
108794 Solutions
New Discussion юеВ

how to get current directory's full pathname in the kernel space?

 
kaijile
Frequent Advisor

how to get current directory's full pathname in the kernel space?

The struct proc has struct vnode *p_cdir ,but i want to get the proc's current directory's full pathname.


Is there have any ways to do it?
2 REPLIES 2
Laurent Menase
Honored Contributor

Re: how to get current directory's full pathname in the kernel space?

Hi Kajile,

same as previous, in the same way you get the file name with pstats

Dennis Handly
Acclaimed Contributor

Re: how to get current directory's full pathname in the kernel space?

I would imagine since users can't do this directly, neither can the kernel.
getcwd(3) must walk the path using opendir .. and searching for the inode of the subdirectory.