aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/cris/c/stat7.c
blob: d61bd8e0c7db8af340496b2f5d048c7af54ece17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
#progos: linux
*/

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>

int main (void)
{
  struct stat buf;

  /* From Linux, we get EFAULT.  The simulator sends us EINVAL.  */
  if (lstat (NULL, &buf) != -1
      || (errno != EINVAL && errno != EFAULT))
    {
      perror ("lstat 1");
      abort ();
    }

  printf ("pass\n");
  exit (0);
}