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] - Rev 842

Compare with Previous | Blame | View Log

/*
#notarget: cris*-*-elf
*/
 
#include <unistd.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
 
/* I can't seem to include the right things, so we do it brute force.  */
int main (void)
{
  static int sysctl_args[] = { 1, 4 };
  size_t x = 8;
 
  struct __sysctl_args {
    int *name;
    int nlen;
    void *oldval;
    size_t *oldlenp;
    void *newval;
    size_t newlen;
    unsigned long __unused[4];
  } scargs
      =
    {
     sysctl_args,
     sizeof (sysctl_args) / sizeof (sysctl_args[0]),
     (void *) -1, &x, NULL, 0
    };
 
  if (syscall (SYS__sysctl, &scargs) != -1
      || errno != EFAULT)
    abort ();
  printf ("pass\n");
  exit (0);
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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