16 /* open a dir stream */
17 dirp = opendir ("/tmp");
27 /* close the directory file descriptor, making it invalid */
28 if (close (dirfd (dirp)) != 0)
30 puts ("could not close directory file descriptor");
31 /* This is not an error. It is not guaranteed this is possible. */
37 return ent != NULL || errno != EBADF;