final decision about *at syscalls
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Apr 16 18:05:51 UTC 2008
On Wed, Apr 16, 2008 at 08:58:32PM +0300, Kostik Belousov wrote:
> On Wed, Apr 16, 2008 at 06:52:12PM +0100, Robert Watson wrote:
> > NDINIT() is already aware of the file descriptor array because it uses that
> > to get the current working and root directories. And what the *at() system
> > calls are effectively doing is substituting another directory for the
> > current working directory. The exact expression of all this doesn't matter
> > all that much to me, but I think evaluating the file descriptor array for
> > directory stuff all in one place, rather than spread over the caller and
> > NDINIT(), is cleaner and avoids a lot of code everywhere. Nothing says you
> > can't have:
> >
> > void
> > NDINIT(struct nameidata *ndp, u_long op, u_long flags,
> > enum uio_seg segflg, const char *namep, struct thread *td);
> >
> > void
> > NDINIT_AT(struct nameidata *ndp, u_long op, u_long flags,
> > enum uio_seg segflg, const char *namep, int fd, struct thread *td);
> >
> > NDINIT_DVP(struct nameidata *ndp, u_long op, u_long flags,
> > enum uio_seg segflg, const char *namep, struct vnode *vp,
> > struct thread *td);
> >
> > However, I think I wouldn't want NDINIT_AT() to be a wrapper for
> > NDINIT_DVP(), because I'd like all that fdp following to occur together.
>
> I already mailed the patch implementing all the above, modulo
> s/_DVP/_ATVP/. I want to get the response from Pawel and others. If
> positive, the patch is to be tested and committed.
Back when we discussed NDINIT_AT(), I was a bit opposed, because I was
afraid that we will grow more NDINIT_<arg>() functions. I preferred to
just initialize additional arguments directly, eg.
NDINIT(&nd, foo, bar);
nd.ni_dirfd = fd;
nd.ni_startvp = dvp;
namei(&nd);
At this point I don't really care, I can use NDINIT_DVP/NDINIT_ATVP.
> I see no reason for heating the debate.
Agreed.
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20080416/1f1c0b88/attachment.pgp
More information about the freebsd-arch
mailing list