mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
1368b914e9
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
42 lines
804 B
C
42 lines
804 B
C
/* Check error message for invalid sysctl call.
|
|
#xerror:
|
|
#output: Unimplemented _sysctl syscall *\n
|
|
#output: program stopped with signal 4 (*).\n
|
|
#notarget: cris*-*-elf
|
|
*/
|
|
|
|
#include <unistd.h>
|
|
#include <sys/syscall.h>
|
|
#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <errno.h>
|
|
|
|
int main (void)
|
|
{
|
|
static int sysctl_args[] = { 99, 99 };
|
|
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
|
|
};
|
|
|
|
int err = syscall (SYS__sysctl, &scargs);
|
|
if (err == -1 && errno == ENOSYS)
|
|
printf ("ENOSYS\n");
|
|
printf ("xyzzy\n");
|
|
exit (0);
|
|
}
|