Subject: Re: bug#10305: coreutils-8.14, "rm -r" fails with EBADF

From: Eric Blake <[email-masked]>
Date: Wed, 21 Dec 2011 09:27:58 -0700

On 12/21/2011 09:06 AM, Jim Meyering wrote:
>>
>> Where to go now?
>>
>> Resorting to wild guesses, I tried all 3 members of struct DIR as
>> DIF_FD_MEMBER_NAME, no change to the EBADF
> 
> Write a small test program that opens say four directories,
> to get one DIR* pointer for each.  Then print a table of
> the DIR member values.  Maybe you'll see a pattern, i.e.,
> how to derive an FD number from those dd1,2,3 fields.

If the NonStop opendir() does not open a directory fd under the hood,
then maybe we should wrap opendir() so that the gnulib rpl_opendir()
always opens a directory at the same time; at which point the gnulib
rpl_dirfd merely returns that directory fd.

Also, does NonStop have anything like Linux' /proc/self/fd or lsof, for
reverse engineering which fds a process has open and on what files?  Is
there an equivalent to strace functionality for tracking all syscalls
made by libc?

-- 
Eric Blake   [email-masked]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org