[klibc] [klibc:ia64-signal-fix] signal: Add config flag for additional sigaction fixup

klibc-bot for Ben Hutchings ben at decadent.org.uk
Fri Aug 28 12:36:05 PDT 2020


Commit-ID:  a1556c691981c0651d8179db53665a6cf1be7953
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=a1556c691981c0651d8179db53665a6cf1be7953
Author:     Ben Hutchings <ben at decadent.org.uk>
AuthorDate: Fri, 28 Aug 2020 19:37:19 +0100
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 28 Aug 2020 20:22:50 +0100

[klibc] signal: Add config flag for additional sigaction fixup

On ia64, sigaction() needs to make further changes to the given
struct sigaction.  Add a config flag for this, that forces copying
of struct sigaction.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 usr/include/klibc/sysconfig.h | 11 +++++++++++
 usr/klibc/sigaction.c         |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/usr/include/klibc/sysconfig.h b/usr/include/klibc/sysconfig.h
index 5722e04f..d658ad30 100644
--- a/usr/include/klibc/sysconfig.h
+++ b/usr/include/klibc/sysconfig.h
@@ -176,6 +176,17 @@
 #endif
 
 
+/*
+ * _KLIBC_NEEDS_SIGACTION_FIXUP
+ *
+ *	On some architectures, struct sigaction needs additional
+ *	changes before passing to the kernel.
+ */
+#ifndef _KLIBC_NEEDS_SIGACTION_FIXUP
+# define _KLIBC_NEEDS_SIGACTION_FIXUP 0
+#endif
+
+
 /*
  * _KLIBC_STATFS_F_TYPE_64:
  *
diff --git a/usr/klibc/sigaction.c b/usr/klibc/sigaction.c
index d2223843..ed4cf5b5 100644
--- a/usr/klibc/sigaction.c
+++ b/usr/klibc/sigaction.c
@@ -28,7 +28,9 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
 	struct sigaction sa;
 	int rv;
 
-	if (act && (act->sa_flags & needed_flags) != needed_flags) {
+	if (act &&
+	    ((act->sa_flags & needed_flags) != needed_flags ||
+	     _KLIBC_NEEDS_SIGACTION_FIXUP)) {
 		sa = *act;
 		sa.sa_flags |= needed_flags;
 #if _KLIBC_NEEDS_SA_RESTORER


More information about the klibc mailing list