public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Steve Muckle <smuckle@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/rt_tgsigqueueinfo: fix compilation for Android
Date: Wed,  6 Mar 2019 15:44:52 -0800	[thread overview]
Message-ID: <20190306234452.197997-1-smuckle@google.com> (raw)

Glibc refers to the sigval_t in _sifields._rt as si_sigval. This
differs from what is in the kernel's uapi siginfo.h, _sigval, which is
what is used by Android's bionic.

Signed-off-by: Steve Muckle <smuckle@google.com>
---
 .../rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c       | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c
index 4ae17c220..c8252ed8a 100644
--- a/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c
+++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c
@@ -18,12 +18,19 @@
  */
 
 #define _GNU_SOURCE
+
 #include <err.h>
 #include <pthread.h>
 #include "tst_safe_pthread.h"
 #include "tst_test.h"
 #include "lapi/syscalls.h"
 
+#ifndef ANDROID
+#define SI_SIGVAL si_sigval
+#else
+#define SI_SIGVAL _sigval
+#endif
+
 static char sigval_send[] = "rt_tgsigqueueinfo data";
 static volatile int signum_rcv;
 static char *sigval_rcv;
@@ -32,7 +39,7 @@ static void sigusr1_handler(int signum, siginfo_t *uinfo,
 			    void *p LTP_ATTRIBUTE_UNUSED)
 {
 	signum_rcv = signum;
-	sigval_rcv = uinfo->_sifields._rt.si_sigval.sival_ptr;
+	sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
 }
 
 void *send_rcv_func(void *arg)
@@ -44,7 +51,7 @@ void *send_rcv_func(void *arg)
 
 	uinfo.si_errno = 0;
 	uinfo.si_code = SI_QUEUE;
-	uinfo._sifields._rt.si_sigval.sival_ptr = sigval_send;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
 
 	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
 			 syscall(__NR_gettid), SIGUSR1, &uinfo));
@@ -106,7 +113,7 @@ static void verify_signal_parent_thread(void)
 
 	uinfo.si_errno = 0;
 	uinfo.si_code = SI_QUEUE;
-	uinfo._sifields._rt.si_sigval.sival_ptr = sigval_send;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
 
 	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
 			 tid, SIGUSR1, &uinfo));
@@ -123,7 +130,7 @@ void *sender_func(void *arg)
 
 	uinfo.si_errno = 0;
 	uinfo.si_code = SI_QUEUE;
-	uinfo._sifields._rt.si_sigval.sival_ptr = sigval_send;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
 
 	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
 			 *tid, SIGUSR1, &uinfo));
-- 
2.21.0.352.gf09ad66450-goog


             reply	other threads:[~2019-03-06 23:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 23:44 Steve Muckle [this message]
2019-03-07  5:31 ` [LTP] [PATCH] syscalls/rt_tgsigqueueinfo: fix compilation for Android Sumit Garg
2019-03-07  8:52 ` Cyril Hrubis

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=20190306234452.197997-1-smuckle@google.com \
    --to=smuckle@google.com \
    --cc=ltp@lists.linux.it \
    /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