On Tue, 20 May 2008, NiuLin wrote:

> Hello everyone:
> When I am programming a kernel module for Solaris, I encountered one
> problem: I cannot get the the absolute path for the current working
> directory of the current process.
>
> In user space, we can do this by calling getcwd(), but this function does
> not take kernel address as parameter so I can not call it in the kernel.
>
> Then how can I getcwd in the kernel?
>
> I can get the vnode pointer of the current dir, If there are any some easy
> ways to convert the vnode pointer to the absolute path name, it's ok too.

Use this one:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/lookup.c#vnodetopath

FrankH.
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to