[klibc] Add fdopendir(), fix dirfd()

Add fdopendir() by splitting opendir() into two components.  Note
that the fdopendir() implementation doesn't actually check the
validity of the file descriptor; we just let readdir() return an error
if someone passed us garbage.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2 files changed