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

20 lines
438 B
C
Raw Normal View History

2024-01-29 10:44:43 +08:00
/* Check unimplemented-output for mprotect call.
#progos: linux
#xerror:
#output: Unimplemented mprotect call (0x0, 0x2001, 0x4)\n
#output: program stopped with signal 4 (*).\n
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/mman.h>
#include <errno.h>
int main (int argc, char *argv[])
{
int err = mprotect (0, 8193, PROT_EXEC);
if (err == -1 && errno == ENOSYS)
printf ("ENOSYS\n");
printf ("xyzzy\n");
exit (0);
}