1 /*
2 #notarget: cris*-*-elf
3 */
4 
5 #include <unistd.h>
6 #include <sys/syscall.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <errno.h>
10 
11 /* I can't seem to include the right things, so we do it brute force.  */
main(void)12 int main (void)
13 {
14   static int sysctl_args[] = { 1, 4 };
15   size_t x = 8;
16 
17   struct __sysctl_args {
18     int *name;
19     int nlen;
20     void *oldval;
21     size_t *oldlenp;
22     void *newval;
23     size_t newlen;
24     unsigned long __unused[4];
25   } scargs
26       =
27     {
28      sysctl_args,
29      sizeof (sysctl_args) / sizeof (sysctl_args[0]),
30      (void *) -1, &x, NULL, 0
31     };
32 
33   if (syscall (SYS__sysctl, &scargs) != -1
34       || errno != EFAULT)
35     abort ();
36   printf ("pass\n");
37   exit (0);
38 }
39