Browse Source

Try to mimic glibc sigaction, sjhill, could you please test w/ this version?

Peter S. Mazinger 20 years ago
parent
commit
121d3f0fa2

+ 6 - 7
libc/signal/sigaction.c

@@ -32,8 +32,8 @@
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden
-__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
 	int result;
 	int result;
 	struct kernel_sigaction kact, koact;
 	struct kernel_sigaction kact, koact;
@@ -69,8 +69,8 @@ __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oa
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden
-__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
 	int result;
 	int result;
 	struct old_kernel_sigaction kact, koact;
 	struct old_kernel_sigaction kact, koact;
@@ -102,6 +102,5 @@ __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oa
 
 
 #endif
 #endif
 
 
-strong_alias(__sigaction_internal,__libc_sigaction)
-weak_alias(__sigaction_internal,__sigaction)
-weak_alias(__sigaction_internal,sigaction)
+hidden_weak_alias(__libc_sigaction,__sigaction)
+weak_alias(__libc_sigaction,sigaction)

+ 1 - 1
libc/signal/sigignore.c

@@ -18,7 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <errno.h>
 #include <errno.h>

+ 1 - 1
libc/signal/sigintr.c

@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 
 
 #include <stddef.h>
 #include <stddef.h>
 #include <signal.h>
 #include <signal.h>

+ 1 - 1
libc/signal/signal.c

@@ -18,7 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>

+ 1 - 1
libc/signal/sigset.c

@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 
 
 #include <errno.h>
 #include <errno.h>
 #define __need_NULL
 #define __need_NULL

+ 1 - 1
libc/signal/sysv_signal.c

@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
    02111-1307 USA.  */
 
 
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>

+ 4 - 4
libc/sysdeps/linux/arm/sigaction.c

@@ -46,7 +46,7 @@ extern void __default_rt_sa_restorer(void);
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct kernel_sigaction kact, koact;
     struct kernel_sigaction kact, koact;
@@ -94,7 +94,7 @@ int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act,
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct old_kernel_sigaction kact, koact;
     struct old_kernel_sigaction kact, koact;
@@ -127,6 +127,6 @@ int __sigaction_internal (int sig, const struct sigaction *act, struct sigaction
 }
 }
 
 
 #endif
 #endif
-strong_alias(__sigaction_internal,__libc_sigaction)
-weak_alias(__sigaction_internal, sigaction)
+hidden_weak_alias(__libc_sigaction,__sigaction)
+weak_alias(__libc_sigaction,sigaction)
 
 

+ 1 - 1
libc/sysdeps/linux/common/ssp.c

@@ -31,7 +31,7 @@
 #define closelog __closelog
 #define closelog __closelog
 #define sigfillset __sigfillset_internal
 #define sigfillset __sigfillset_internal
 #define sigdelset __sigdelset_internal
 #define sigdelset __sigdelset_internal
-#define sigaction __sigaction_internal
+#define sigaction __sigaction
 #define kill __kill
 #define kill __kill
 
 
 #include <string.h>
 #include <string.h>

+ 4 - 4
libc/sysdeps/linux/i386/sigaction.c

@@ -34,7 +34,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct kernel_sigaction kact, koact;
     struct kernel_sigaction kact, koact;
@@ -76,7 +76,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct old_kernel_sigaction kact, koact;
     struct old_kernel_sigaction kact, koact;
@@ -119,8 +119,8 @@ int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act,
 }
 }
 
 
 #endif
 #endif
-strong_alias(__sigaction_internal,__libc_sigaction)
-weak_alias(__sigaction_internal, sigaction)
+hidden_weak_alias(__libc_sigaction,__sigaction)
+weak_alias(__libc_sigaction,sigaction)
 
 
 
 
 
 

+ 4 - 4
libc/sysdeps/linux/mips/sigaction.c

@@ -32,7 +32,7 @@
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct kernel_sigaction kact, koact;
     struct kernel_sigaction kact, koact;
@@ -77,7 +77,7 @@ extern void restore (void) asm ("__restore") attribute_hidden;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
     int result;
     int result;
     struct old_kernel_sigaction kact, koact;
     struct old_kernel_sigaction kact, koact;
@@ -118,5 +118,5 @@ int attribute_hidden __sigaction_internal (int sig, const struct sigaction *act,
 }
 }
 
 
 #endif
 #endif
-strong_alias(__sigaction_internal,__libc_sigaction)
-weak_alias(__sigaction_internal,sigaction)
+hidden_weak_alias(__libc_sigaction,__sigaction)
+weak_alias(__libc_sigaction,sigaction)

+ 6 - 6
libc/sysdeps/linux/x86_64/sigaction.c

@@ -46,8 +46,8 @@ extern void restore (void) asm ("__restore") attribute_hidden;
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
 /* psm: couldn't use __sigaction, if building w/ disabled hidden,
 /* psm: couldn't use __sigaction, if building w/ disabled hidden,
  *      it will conflict w/ the one in libpthread */
  *      it will conflict w/ the one in libpthread */
-int attribute_hidden
-__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
 	int result;
 	int result;
 	struct kernel_sigaction kact, koact;
 	struct kernel_sigaction kact, koact;
@@ -79,8 +79,8 @@ extern void restore (void) asm ("__restore") attribute_hidden;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int attribute_hidden
-__sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
 {
 	int result;
 	int result;
 	struct old_kernel_sigaction kact, koact;
 	struct old_kernel_sigaction kact, koact;
@@ -119,8 +119,8 @@ __sigaction_internal (int sig, const struct sigaction *act, struct sigaction *oa
 	return result;
 	return result;
 }
 }
 #endif
 #endif
-strong_alias(__sigaction_internal,__libc_sigaction)
-weak_alias(__sigaction_internal,sigaction)
+hidden_weak_alias(__libc_sigaction,__sigaction)
+weak_alias(__libc_sigaction,sigaction)
 
 
 /* NOTE: Please think twice before making any changes to the bits of
 /* NOTE: Please think twice before making any changes to the bits of
    code below.  GDB needs some intimate knowledge about it to
    code below.  GDB needs some intimate knowledge about it to