Properly set the siginfo errno on SIGSEGV
authorKevin Klues <klueska@cs.berkeley.edu>
Sat, 7 Jun 2014 19:45:00 +0000 (12:45 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Sat, 7 Jun 2014 19:45:00 +0000 (12:45 -0700)
Also explciitly set the signal number (though this will be set
underneath anyway).

user/pthread/pthread.c

index 924db08..a371007 100644 (file)
@@ -322,6 +322,8 @@ void pth_thread_refl_fault(struct uthread *uthread, unsigned int trap_nr,
        if (!(err & PF_VMR_BACKED)) {
                if (!__sigismember(&pthread->sigmask, SIGSEGV)) {
                        struct siginfo info = {0};
        if (!(err & PF_VMR_BACKED)) {
                if (!__sigismember(&pthread->sigmask, SIGSEGV)) {
                        struct siginfo info = {0};
+                       info.si_signo = SIGSEGV;
+                       info.si_errno = trap_nr;
                        info.si_code = SEGV_MAPERR;
                        info.si_addr = (void*)aux;
                        __pthread_trigger_posix_signal(pthread, SIGSEGV, &info);
                        info.si_code = SEGV_MAPERR;
                        info.si_addr = (void*)aux;
                        __pthread_trigger_posix_signal(pthread, SIGSEGV, &info);