/* Open a directory stream on NAME. */ DIR * __opendir (const char *name) { #if 0 /* TODO. */ return __opendirat (AT_FDCWD, name); #else if (name[0] == '\0') { /* POSIX.1-1990 says an empty name gets ENOENT; but `open' might like it fine. */ __set_errno (ENOENT); return NULL; } int fd = __open (name, O_RDONLY | O_NONBLOCK | O_DIRECTORY); if (fd < 0) return NULL; /* Extract the pointer to the descriptor structure. */ DIR *dirp = _hurd_fd_opendir (_hurd_fd_get (fd)); if (dirp == NULL) __close (fd); return dirp; #endif }
/* Open a directory stream on NAME. */ DIR * __opendir (const char *name) { return __opendirat (AT_FDCWD, name); }