Home | History | Annotate | Line # | Download | only in c
      1  1.1  christos /*
      2  1.1  christos #progos: linux
      3  1.1  christos */
      4  1.1  christos 
      5  1.1  christos #include <sys/types.h>
      6  1.1  christos #include <sys/stat.h>
      7  1.1  christos #include <unistd.h>
      8  1.1  christos #include <stdio.h>
      9  1.1  christos #include <errno.h>
     10  1.1  christos #include <stdlib.h>
     11  1.1  christos 
     12  1.1  christos int main (void)
     13  1.1  christos {
     14  1.1  christos   struct stat buf;
     15  1.1  christos 
     16  1.1  christos   /* From Linux, we get EFAULT.  The simulator sends us EINVAL.  */
     17  1.1  christos   if (lstat (NULL, &buf) != -1
     18  1.1  christos       || (errno != EINVAL && errno != EFAULT))
     19  1.1  christos     {
     20  1.1  christos       perror ("lstat 1");
     21  1.1  christos       abort ();
     22  1.1  christos     }
     23  1.1  christos 
     24  1.1  christos   printf ("pass\n");
     25  1.1  christos   exit (0);
     26  1.1  christos }
     27