dirfd.c 160 B

123456789101112
  1. #include <errno.h>
  2. #include "dirstream.h"
  3. int dirfd(DIR * dir)
  4. {
  5. if (!dir || dir->dd_fd == -1) {
  6. __set_errno(EBADF);
  7. return -1;
  8. }
  9. return dir->dd_fd;
  10. }