OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [sim/] [testsuite/] [sim/] [cris/] [c/] [sysctl1.c] - Diff between revs 157 and 223

Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

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