OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sysctl1.c] - Blame information for rev 842

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
/*
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.  */
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.