On 03/18/2015 09:16 AM, Eli Zaretskii wrote:
An alternative would be to use Gnulib's opendir instead, which seems
to already take care of allocating a file descriptor.  However,
Gnulib's opendir is not being linked into the test program; instead,
MinGW's own opendir is.

That doesn't sound right. The whole point of the dir business on Windows (as I understand it) is to wrap all the directory primitives, and opendir ought to be one of those primitives. Perhaps someone could investigate why the Gnulib opendir isn't being used here, as it should be.

I don't see how Gnulib's dirfd could work for MinGW

It depends on what one means by "work". POSIX allows dirfd to return -1 and set errno = ENOTSUP. If gnulib dirfd does that on MinGW, dirfd's callers should do the right thing when that happens.

Reply via email to