Re: Current Directory of a Process
Re: Current Directory of a Process
- Subject: Re: Current Directory of a Process
- From: Robert Sandilands <email@hidden>
- Date: Wed, 11 Jun 2003 11:03:37 -0400
I can get the vnode pointing to the current directory, and that is
good... Sort of. I need to be able to translate this vnode to a path
name to be used in user space. I have poured through the kernel and
not found a way to do that. In desperation I downloaded the code for
Libc and looked at the getcwd code. Horror! If you want to spend some
sleepless nights having nightmares look at Libc/gen/getcwd.c.
Obviously that type of solution is not practical for the kernel.
Any ideas how to translate a vnode to a path? Or any other ideas how
to get the current directory?
Thanks
Robert Sandilands
On Monday, June 9, 2003, at 06:33 PM, Justin C. Walker wrote:
On Monday, June 9, 2003, at 02:52 PM, Robert Sandilands wrote:
I have a struct proc * inside a sysent[xxx] call and from there want
to get the current working directory of the process that initiated
the action. I have looked through the kernel and the mailing list
archives and not found any obvious pointers.
Does anybody have any ideas?
You can look at xnu/bsd/vfs/vfs_syscalls:chdir() to see how the
various structures are stitched together. Is this what you are
looking for?
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | Some people have a mental
| horizon of radius zero, and
| call it their point of view.
| -- David Hilbert
*--------------------------------------
*-------------------------------*
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.
---------------------------------------------------------------------
#include
http://robert.rsa3.com/disclaimer.html
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.