linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vineet.Gupta1@synopsys.com (Vineet Gupta)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH] rt_sigaction.h: adjust for ARC
Date: Fri, 4 Mar 2016 16:52:17 +0530	[thread overview]
Message-ID: <1457090537-23825-1-git-send-email-vgupta@synopsys.com> (raw)

ARC uses the no-legacy syscall ABI where there is no need for
kernel_sigaction interworking.

Further we rely on default SA_RESTORER in libc for sigreturn.

To me all the song-and-dance in ltp_rt_sigaction() doesn't make sense.
The intent it to test whatever platform libc + kernel combination
provides and to that end any fixups in LTP seem odd to me.
So for ARC just call what libc provides and don't claim to support
more/less.

e.g. rt_sigaction02 fails for ARC, since libc sigaction does following

| int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
| {
|	struct sigaction kact;
|
|	if (act && !(act->sa_flags & SA_RESTORER)) {
|		kact.sa_restorer = __default_rt_sa_restorer;

So we don't get the EFAULT for @act == -1 which kernel would provide.
Instead we get a segv rightawat. But that's fine, that is how our system
works.

Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
---
 include/lapi/rt_sigaction.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
index 3a5a763ce094..12af3c3b7b27 100644
--- a/include/lapi/rt_sigaction.h
+++ b/include/lapi/rt_sigaction.h
@@ -155,6 +155,13 @@ static void __attribute__((used)) __sigreturn_stub(void)
 static int ltp_rt_sigaction(int signum, const struct sigaction *act,
 			struct sigaction *oact, size_t sigsetsize)
 {
+#ifdef __arc__
+	/*
+	 * No playing games with various internals of sigaction / fields
+	 * just use whatever libc + kernel provide
+	 */
+	return sigaction(signum, act, oact);
+#else
 	int ret;
 	struct kernel_sigaction kact, koact;
 	struct kernel_sigaction *kact_p = NULL;
@@ -218,6 +225,7 @@ static int ltp_rt_sigaction(int signum, const struct sigaction *act,
 	}
 
 	return ret;
+#endif
 }
 
 #endif /* LTP_RT_SIGACTION_H */
-- 
2.5.0

             reply	other threads:[~2016-03-04 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 11:22 Vineet Gupta [this message]
     [not found] ` <20160307101319.GB3559@rei.suse.cz>
2016-03-07 10:39   ` [LTP] [PATCH] rt_sigaction.h: adjust for ARC Vineet Gupta
     [not found]     ` <20160307105747.GC3559@rei.suse.cz>
2016-03-07 11:50       ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457090537-23825-1-git-send-email-vgupta@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).