3 #include "diskBack.unix.c"
4 #include "mmap-protect.c"
9 void GC_displayMem (void) {
10 static char buffer
[256];
12 snprintf (buffer
, cardof(buffer
), "/bin/cat /proc/%d/map\n", (int)getpid ());
13 (void)system (buffer
);
16 static void catcher (__attribute__ ((unused
)) int signo
,
17 __attribute__ ((unused
)) siginfo_t
* info
,
19 ucontext_t
* ucp
= (ucontext_t
*)context
;
20 #if (defined (__x86_64__))
21 GC_handleSigProf ((code_pointer
) ucp
->uc_mcontext
.mc_rip
);
22 #elif (defined (__i386__))
23 GC_handleSigProf ((code_pointer
) ucp
->uc_mcontext
.mc_eip
);
25 #error Profiling handler is missing for this architecture
29 void GC_setSigProfHandler (struct sigaction
*sa
) {
30 sa
->sa_flags
= SA_ONSTACK
| SA_RESTART
| SA_SIGINFO
;
31 sa
->sa_sigaction
= (void (*)(int, siginfo_t
*, void*))catcher
;