diff options
Diffstat (limited to 'sys/i386/linux/linux_sysvec.c')
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 134ff9e..a7da306 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.26 1998/02/13 07:34:52 bde Exp $ + * $Id: linux_sysvec.c,v 1.27 1998/04/13 17:49:51 sos Exp $ */ /* XXX we use functions that might not exist. */ @@ -98,6 +98,29 @@ int linux_to_bsd_signal[LINUX_NSIG] = { SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGURG, SIGURG, 0 }; +/* + * If FreeBSD & Linux have a difference of opinion about what a trap + * means, deal with it here. + */ +static int +translate_traps(int signal, int trap_code) +{ + switch(signal) { + case SIGBUS: + switch(trap_code) { + case T_PROTFLT: + case T_TSSFLT: + case T_DOUBLEFLT: + case T_PAGEFLT: + return SIGSEGV; + default: + return signal; + } + default: + return signal; + } +} + static int linux_fixup(int **stack_base, struct image_params *imgp) { @@ -374,6 +397,7 @@ struct sysentvec linux_sysvec = { bsd_to_linux_signal, ELAST, bsd_to_linux_errno, + translate_traps, linux_fixup, linux_sendsig, linux_sigcode, @@ -390,6 +414,7 @@ struct sysentvec elf_linux_sysvec = { bsd_to_linux_signal, ELAST, bsd_to_linux_errno, + translate_traps, elf_linux_fixup, linux_sendsig, linux_sigcode, |