dir_fd.c (302B)
1 /* ISC license. */ 2 3 #include <skalibs/sysdeps.h> 4 #include <skalibs/nonposix.h> 5 #include <skalibs/direntry.h> 6 7 #ifdef SKALIBS_HASDIRFD 8 9 int dir_fd (DIR *dir) 10 { 11 return dirfd(dir) ; 12 } 13 14 #else 15 16 /* Pokes at the internals of DIR - no choice here */ 17 18 int dir_fd (DIR *dir) 19 { 20 return dir->dd_fd ; 21 } 22 23 #endif