2005-11-21 12:48:19 +08:00
|
|
|
/* Test unknown-syscall output.
|
|
|
|
#notarget: cris*-*-elf
|
|
|
|
#xerror:
|
|
|
|
#output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n
|
2012-03-24 13:33:42 +08:00
|
|
|
#output: program stopped with signal 4 (*).\n
|
2005-11-21 12:48:19 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
* sim/cris/c/clone5.c, sim/cris/c/mprotect1.c,
sim/cris/c/rtsigprocmask1.c, sim/cris/c/rtsigsuspend1.c,
sim/cris/c/sig7.c, sim/cris/c/sigreturn1.c,
sim/cris/c/sigreturn2.c, sim/cris/c/syscall1.c,
sim/cris/c/syscall2.c, sim/cris/c/sysctl2.c, sim/cris/c/fcntl1.c,
sim/cris/c/readlink2.c: Add code to print ENOSYS if syscall being
tested returns ENOSYS. Add early exit where needed. Change any
existing code to print "xyzzy", not "pass".
* sim/cris/asm/option3.ms, sim/cris/asm/option4.ms,
sim/cris/c/clone6.c, sim/cris/c/fcntl2.c,
sim/cris/c/mprotect2.c, sim/cris/c/readlink11.c,
sim/cris/c/rtsigprocmask2.c, sim/cris/c/rtsigsuspend2.c,
sim/cris/c/sig13.c, sim/cris/c/sigreturn3.c,
sim/cris/c/sigreturn4.c, sim/cris/c/syscall3.c,
sim/cris/c/syscall4.c, sim/cris/c/syscall5.c,
sim/cris/c/syscall6.c, sim/cris/c/syscall7.c,
sim/cris/c/syscall8.c, sim/cris/c/sysctl3.c: New tests.
2006-10-02 11:18:51 +08:00
|
|
|
#include <errno.h>
|
2005-11-21 12:48:19 +08:00
|
|
|
|
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
/* The number 166 is chosen because there's a gap for that number in
|
|
|
|
the CRIS asm/unistd.h. */
|
* sim/cris/c/clone5.c, sim/cris/c/mprotect1.c,
sim/cris/c/rtsigprocmask1.c, sim/cris/c/rtsigsuspend1.c,
sim/cris/c/sig7.c, sim/cris/c/sigreturn1.c,
sim/cris/c/sigreturn2.c, sim/cris/c/syscall1.c,
sim/cris/c/syscall2.c, sim/cris/c/sysctl2.c, sim/cris/c/fcntl1.c,
sim/cris/c/readlink2.c: Add code to print ENOSYS if syscall being
tested returns ENOSYS. Add early exit where needed. Change any
existing code to print "xyzzy", not "pass".
* sim/cris/asm/option3.ms, sim/cris/asm/option4.ms,
sim/cris/c/clone6.c, sim/cris/c/fcntl2.c,
sim/cris/c/mprotect2.c, sim/cris/c/readlink11.c,
sim/cris/c/rtsigprocmask2.c, sim/cris/c/rtsigsuspend2.c,
sim/cris/c/sig13.c, sim/cris/c/sigreturn3.c,
sim/cris/c/sigreturn4.c, sim/cris/c/syscall3.c,
sim/cris/c/syscall4.c, sim/cris/c/syscall5.c,
sim/cris/c/syscall6.c, sim/cris/c/syscall7.c,
sim/cris/c/syscall8.c, sim/cris/c/sysctl3.c: New tests.
2006-10-02 11:18:51 +08:00
|
|
|
int err = syscall (166, 1, 2, 3, 4, 5, 6);
|
|
|
|
if (err == -1 && errno == ENOSYS)
|
|
|
|
printf ("ENOSYS\n");
|
2005-11-21 12:48:19 +08:00
|
|
|
printf ("xyzzy\n");
|
|
|
|
exit (0);
|
|
|
|
}
|