skalibs

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

tryopenat.c (411B)


      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 
     10 #ifndef _ATFILE_SOURCE
     11 #define _ATFILE_SOURCE
     12 #endif
     13 
     14 #ifndef _INCOMPLETE_XOPEN_C063
     15 #define _INCOMPLETE_XOPEN_C063
     16 #endif
     17 
     18 #ifndef __EXTENSIONS__
     19 #define __EXTENSIONS__
     20 #endif
     21 
     22 #include <sys/stat.h>
     23 #include <fcntl.h>
     24 
     25 int main (void)
     26 {
     27   int fd = openat(0, "/", O_RDONLY) ;
     28   return (fd < 0) ;
     29 }