data/method/gdb/gdb-13.2/sim/testsuite/cris/c/sig7.c

28 lines
545 B
C
Raw Normal View History

2024-01-29 10:44:43 +08:00
/* Check unsupported case of sigaction syscall.
#progos: linux
#xerror:
#output: Unimplemented rt_sigaction syscall (0x8, 0x3df*\n
#output: program stopped with signal 4 (*).\n
*/
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <errno.h>
int
main (void)
{
struct sigaction sa;
int err;
sa.sa_sigaction = NULL;
sa.sa_flags = SA_RESTART | SA_SIGINFO;
sigemptyset (&sa.sa_mask);
err = sigaction (SIGFPE, &sa, NULL);
if (err == -1 && errno == ENOSYS)
printf ("ENOSYS\n");
printf ("xyzzy\n");
exit (0);
}