From: Gianluca Guida Date: Mon, 21 Feb 2011 18:06:54 +0000 (+0000) Subject: Fix signal handling in NBSD libc. X-Git-Tag: v3.2.0~654 X-Git-Url: http://zhaoyanbai.com/repos/doc/man.3.txt?a=commitdiff_plain;h=7b9d99251ff734ade658419f7375b2af7610a363;p=minix.git Fix signal handling in NBSD libc. lib/nbsd_libc/minix-port.patch updated. --- diff --git a/lib/nbsd_libc/arch/i386/gen/setjmp.S b/lib/nbsd_libc/arch/i386/gen/setjmp.S index 4d2a5b5ea..4c528fbef 100644 --- a/lib/nbsd_libc/arch/i386/gen/setjmp.S +++ b/lib/nbsd_libc/arch/i386/gen/setjmp.S @@ -85,7 +85,11 @@ ENTRY(__longjmp14) PIC_PROLOGUE pushl $0 pushl %edx +#ifdef __minix + pushl $2 /* SIG_SETMASK */ +#else pushl $3 /* SIG_SETMASK */ +#endif #ifdef PIC call PIC_PLT(_C_LABEL(__sigprocmask14)) #else diff --git a/lib/nbsd_libc/arch/i386/gen/sigsetjmp.S b/lib/nbsd_libc/arch/i386/gen/sigsetjmp.S index 63fbb0d99..133d41b86 100644 --- a/lib/nbsd_libc/arch/i386/gen/sigsetjmp.S +++ b/lib/nbsd_libc/arch/i386/gen/sigsetjmp.S @@ -85,7 +85,11 @@ ENTRY(__siglongjmp14) PIC_PROLOGUE pushl $0 pushl %edx +#ifdef __minix + pushl $2 /* SIG_SETMASK */ +#else pushl $3 /* SIG_SETMASK */ +#endif #ifdef PIC call PIC_PLT(_C_LABEL(__sigprocmask14)) #else diff --git a/lib/nbsd_libc/minix-port.patch b/lib/nbsd_libc/minix-port.patch index dc7662506..23360b552 100644 --- a/lib/nbsd_libc/minix-port.patch +++ b/lib/nbsd_libc/minix-port.patch @@ -127,6 +127,36 @@ diff -ru /home/netbsd/src/lib/libc/arch/i386/gen/Makefile.inc ./arch/i386/gen/Ma # Common ieee754 constants and functions SRCS+= infinityf_ieee754.c infinity_ieee754.c +diff -ru /home/netbsd/src/lib/libc/arch/i386/gen/setjmp.S ./arch/i386/gen/setjmp.S +--- /home/netbsd/src/lib/libc/arch/i386/gen/setjmp.S 2005-09-13 01:44:08.000000000 +0000 ++++ ./arch/i386/gen/setjmp.S 2011-02-18 17:41:55.000000000 +0000 +@@ -85,7 +85,11 @@ + PIC_PROLOGUE + pushl $0 + pushl %edx ++#ifdef __minix ++ pushl $2 /* SIG_SETMASK */ ++#else + pushl $3 /* SIG_SETMASK */ ++#endif + #ifdef PIC + call PIC_PLT(_C_LABEL(__sigprocmask14)) + #else +diff -ru /home/netbsd/src/lib/libc/arch/i386/gen/sigsetjmp.S ./arch/i386/gen/sigsetjmp.S +--- /home/netbsd/src/lib/libc/arch/i386/gen/sigsetjmp.S 2005-09-13 01:44:08.000000000 +0000 ++++ ./arch/i386/gen/sigsetjmp.S 2011-02-18 17:43:21.000000000 +0000 +@@ -85,7 +85,11 @@ + PIC_PROLOGUE + pushl $0 + pushl %edx ++#ifdef __minix ++ pushl $2 /* SIG_SETMASK */ ++#else + pushl $3 /* SIG_SETMASK */ ++#endif + #ifdef PIC + call PIC_PLT(_C_LABEL(__sigprocmask14)) + #else diff -ru /home/netbsd/src/lib/libc/cdb/cdbr.c ./cdb/cdbr.c --- /home/netbsd/src/lib/libc/cdb/cdbr.c 2010-06-04 03:06:19.000000000 +0000 +++ ./cdb/cdbr.c 2011-02-14 17:48:18.000000000 +0000 @@ -1318,7 +1348,7 @@ diff -ru /home/netbsd/src/lib/libc/include/namespace.h ./include/namespace.h diff -ru /home/netbsd/src/lib/libc/libcincludes.mk ./libcincludes.mk --- /home/netbsd/src/lib/libc/libcincludes.mk 2008-10-26 07:28:06.000000000 +0000 -+++ ./libcincludes.mk 2011-02-15 10:39:27.000000000 +0000 ++++ ./libcincludes.mk 2011-02-21 12:57:21.000000000 +0000 @@ -3,6 +3,22 @@ # Makefile fragment shared across several parts that want to look # inside libc's include tree. diff --git a/nbsd_include/sys/sigtypes.h b/nbsd_include/sys/sigtypes.h index 26e30243b..7e8c5bfbc 100644 --- a/nbsd_include/sys/sigtypes.h +++ b/nbsd_include/sys/sigtypes.h @@ -23,7 +23,11 @@ typedef unsigned long sigset_t; /* * Macro for manipulating signal masks. */ +#ifndef __minix #define __sigmask(n) (1 << (((unsigned int)(n) - 1))) +#else /* __minix */ +#define __sigmask(n) (1 << (unsigned int)(n)) +#endif /* !__minix */ #define __sigaddset(s, n) \ do { \ *(s) = *(unsigned long *)(s) | __sigmask(n); \