Hello!
Here's the patches to add fdopendir/fchdir/dirfd support to FreeMiNT and MiNTlib.
I just took a quick look into the kernel patches and I'm sure that's definitly not enough.
First you must define a format that Fread() give back on an open directory. Then you need to enhance every (I think at least ext2, minix, vfat and the ramfs) xfs to support this new feature and to return this format on a Fread(). At the moment the xfs just return the on disk data (I think this is a very bad idea).
You need also to test this intensivly as until now all code paths of every xfs assume a directory can't be openened (this may lead to unexpected side effects in other parts of the xfs; just allowing open() on a directory is definitly not enough). This is very important as the xfs have the direct control over the filesystem and I'm sure that the data integrity is the most important task every xfs have to fulfill. Playing with the xfs is always very critical. A failure may lead to data loss on the users computer.
* O_DIRECTORY, O_NOFOLLOW & O_NOATIME support, again filesystem driver updates are needed here for those that can support it (patches included)
I aggree with the O_NOFOLLOW & O_NOATIME patch, this seems ok at the first look.
Let me know if anyone can spot any problems with these. But I've been testing coreutils with them and all is pretty good at the moment.
Believe me, that don't mean much about unexpected side effects, hidden bugs and so on.
Regards, Frank -- ATARI FALCON 060 // MILAN 060 ----------------------------- http://sparemint.org/ e-Mail: fnaumann@boerde.de