[EMAIL PROTECTED] wrote:
>
>
> >Either approach (opendir()/dirfd() or open()/fdopendir())
> >might be handy on Solaris or anything else that has openat(),
> >for use with multithreaded programs.
>
>
> (To be honest, our next revision of rm will store both an fd and a DIR*;
> with dirfd() it would need to only store the DIR *)
Did you try to think on how the code would look then?
The equivalent of chdir("..") would be
ndfd = openat(dfd, "..", O_RDONLY);
close(dfd);
dfd = ndfd;
vs:
ndfd = openat(dirfd(dp), "..", O_RDONLY);
closedir(dp);
dp = fdopendir(ndfd);
Whether this maes sense depends on the rest of the code.
Jörg
--
EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
[EMAIL PROTECTED] (uni)
[EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-discuss mailing list
[email protected]