skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

trydirfd.c (310B)


      1 /* ISC license. */
      2 
      3 #undef _POSIX_C_SOURCE
      4 #undef _XOPEN_SOURCE
      5 
      6 #ifndef _GNU_SOURCE
      7 #define _GNU_SOURCE
      8 #endif
      9 #ifndef _NETBSD_SOURCE
     10 #define _NETBSD_SOURCE
     11 #endif
     12 #ifndef __EXTENSIONS__
     13 #define __EXTENSIONS__
     14 #endif
     15 
     16 #include <dirent.h>
     17 
     18 int main (void)
     19 {
     20   DIR *dir = opendir(".") ;
     21   return dirfd(dir) ;
     22 }