|
Description
|
Category
library
Sub-Category
libc
Description
Many other Unix like OSes (Linux, OpenBSD, and I believe OSX) provide a dirfd() to return the file descriptor underlying a directory handle:
foo = opendir(".");
fd = dirfd(foo);
We should join the party.
Frequency
Always
Regression
No
Steps to Reproduce
N/A
Expected Result
N/A
Actual Result
N/A
Error Message(s)
Test Case
Workaround
It's mostly possible to work around this while porting 3rd party software, by open()ing the directory, and fdopendir()ing the returned fd, but that may not be possible on other systems as fdopendir() appears to be non-standard.
A not particularly tasteful workaround, which depends on the internals of DIR, would be:
#if defined(__sun) && defined(__SVR4)
#define dirfd(dirp) (dirp->dd_fd)
#endif
Submitter wants to work on bug
No
Additional configuration information
|