Re: Problem Calling namei
Re: Problem Calling namei
- Subject: Re: Problem Calling namei
- From: mominabrar <email@hidden>
- Date: Wed, 30 Sep 2009 18:55:21 +0530
On Tue, Sep 29, 2009 at 10:33 PM, Terry Lambert
<email@hidden> wrote:
If you are implementing an "ls", you are doing it un user space so what KPI is visible in the kernel should not be an issue for you.
For most things the correct API is getattrlist. For private communication between your "ls" and a specific FS implementation (presumably your own), fsctl/ioctl/fcntl are the interfaces to use. If
Right the ioctl interface is what i am using.
and traditionally namei and family of functions could be used to get this done.
With xnu-1228.9.75 these set of APIs are no longer available.
Also vnode_lookup internally uses these.( xnu-1228.9.59 atleast )
What i want to know what replaces these set of APIs (or their functionality ) in the new kernel.
Also i could figure this out looking at the xnu source myself but the latest source i could find at the apple site (
http://www.opensource.apple.com/source/xnu/ ) was for xnu-1228.9.59 which still uses
namei.
NOTE: as Anubhav rightly pointed out i can use vnode_lookup, but that needs a copyin of user name buffer to pass it to vnode_lookup .
you use this approach, make sure your argument structure is size invariant between 32 and 64 bit so you don't have to carry around 64/32 conversion functions, which can otherwise get hairy when taking into account 32/64 user on 32/64 kernel. For example, if you need to pass a pointer, pass it in a uint64_t/unsigned long long (you should try to keep away from passing pointers and stay in the argument size bounds for the *ctl copy in/out to avoid multiple u/k boundary crossings, if at all possible).
Thanks for pointing that out
-- Terry
On Sep 29, 2009, at 7:17 AM, mominabrar <
email@hidden> wrote:
Hi,
I am trying to implement my filesystem specific ls (to give more file info specific to my fs)
The issue is my kernel seems to be missing the namei family of functions, namely:
int namei(struct nameidata *ndp);
void nameidone(struct nameidata *);
Obviously, also the header files lack definition for struct nameidata. (bsd/sys/namei.h)
Any pointers on why they are missing or how i could achieve the same functionality are appreciated.
#uname -a
Darwin macmini1 9.6.1 Darwin Kernel Version 9.6.1: Wed Dec 10 10:38:33 PST 2008; root:xnu-1228.9.75~3/RELEASE_I386 i386
Calling VNOP_LOOKUP in not an option, as all i have is a relative path name.
--
Regards
abrarahmed
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden