461 |
|
} |
462 |
|
|
463 |
|
#ifdef CONFIGURE_TEST_VM_MAP |
464 |
+ |
#include <stdlib.h> |
465 |
+ |
#include <signal.h> |
466 |
+ |
|
467 |
+ |
static void fault_handler(int sig) |
468 |
+ |
{ |
469 |
+ |
exit(1); |
470 |
+ |
} |
471 |
+ |
|
472 |
|
/* Tests covered here: |
473 |
|
- TEST_VM_PROT_* program slices actually succeeds when a crash occurs |
474 |
|
- TEST_VM_MAP_ANON* program slices succeeds when it could be compiled |
476 |
|
int main(void) |
477 |
|
{ |
478 |
|
vm_init(); |
479 |
+ |
|
480 |
+ |
signal(SIGSEGV, fault_handler); |
481 |
+ |
#ifdef SIGBUS |
482 |
+ |
signal(SIGBUS, fault_handler); |
483 |
+ |
#endif |
484 |
|
|
485 |
|
#define page_align(address) ((char *)((unsigned long)(address) & -page_size)) |
486 |
|
unsigned long page_size = vm_get_page_size(); |