hack some stuff towards running on mac... unrelated bugs still..
[c11tester.git] / snapshot.cc
index 5a25bb14efbe24bbf88ad0e4d6de8238316f884b..e3ca558878d2a811bb1f639e6234e2c475023326 100644 (file)
@@ -136,10 +136,17 @@ void initSnapShotLibrary(unsigned int numbackingpages,
        sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESTART | SA_ONSTACK;
        sigemptyset( &sa.sa_mask );
        sa.sa_sigaction = HandlePF;
        sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESTART | SA_ONSTACK;
        sigemptyset( &sa.sa_mask );
        sa.sa_sigaction = HandlePF;
+#ifdef MAC
+       if( sigaction( SIGBUS, &sa, NULL ) == -1 ){
+               printf("SIGACTION CANNOT BE INSTALLED\n");
+               exit(EXIT_FAILURE);
+       }
+#endif
        if( sigaction( SIGSEGV, &sa, NULL ) == -1 ){
                printf("SIGACTION CANNOT BE INSTALLED\n");
                exit(EXIT_FAILURE);
        }
        if( sigaction( SIGSEGV, &sa, NULL ) == -1 ){
                printf("SIGACTION CANNOT BE INSTALLED\n");
                exit(EXIT_FAILURE);
        }
+
        initSnapShotRecord(numbackingpages, numsnapshots, nummemoryregions);
 
        // EVIL HACK: We need to make sure that calls into the HandlePF method don't cause dynamic links
        initSnapShotRecord(numbackingpages, numsnapshots, nummemoryregions);
 
        // EVIL HACK: We need to make sure that calls into the HandlePF method don't cause dynamic links