>Linux started to support openat() recently and for this reason,
>the best way of implementing a portable way of directory search without
>path length limitation is to use:
>
>ndfd = openat(dfd, "dname", O_RDONLY);
>close(dfd);
>dfd = ndfd;
>dp = fdopendir(dup(dfd));
Interesting is, of course, that /proc/self/fd has made this obsolete
in an interesting sense.
(openat maps to:
sprintf(buf, "/proc/self/%d/%s", dfd, dname);
Not sure why you have all the dup's in there.
>Note: error handling omitted for readability.
>
>If Linux is missing fdopendir(), you should better ask the Linux people
>to add fdopendir(), as openat() is already accepted for the next POSIX
>standard AFAIK.
Possibly; we've just rewritten "rm" to use openat/fdopendir/accessat()
Casper
_______________________________________________
opensolaris-discuss mailing list
[email protected]