Merge "MIPS32: Make sigset64_t equal to sigset_t"

am: 919dd9dcb4

Change-Id: I5fd10e2653a645470fde6b23b63db2b9ed6b0647
This commit is contained in:
Goran Jakovljevic 2018-02-12 19:01:44 +00:00 committed by android-build-merger
commit 52d1ff5329
2 changed files with 10 additions and 2 deletions

View file

@ -81,8 +81,10 @@ typedef __sighandler_t sighandler_t; /* glibc compatibility. */
#define si_timerid si_tid /* glibc compatibility. */
/* sigset_t is already large enough on LP64, but LP32's sigset_t is just `unsigned long`. */
#if defined(__LP64__)
/* sigset_t is already large enough on LP64 and mips, but other LP32's sigset_t
* is just `unsigned long`.
*/
#if defined(__LP64__) || defined(__mips__)
typedef sigset_t sigset64_t;
#else
typedef struct { unsigned long __bits[_KERNEL__NSIG/LONG_BIT]; } sigset64_t;

View file

@ -285,7 +285,9 @@ static void TestSigAction(int (sigaction_fn)(int, const SigActionT*, SigActionT*
ASSERT_TRUE(original_sa.sa_handler == NULL);
ASSERT_TRUE(original_sa.sa_sigaction == NULL);
ASSERT_EQ(0U, original_sa.sa_flags & ~sa_restorer);
#ifdef SA_RESTORER
ASSERT_EQ(bool(original_sa.sa_flags & sa_restorer), bool(original_sa.sa_restorer));
#endif
// Set a traditional sa_handler signal handler.
auto no_op_signal_handler = [](int) {};
@ -301,7 +303,9 @@ static void TestSigAction(int (sigaction_fn)(int, const SigActionT*, SigActionT*
ASSERT_TRUE(sa.sa_handler == no_op_signal_handler);
ASSERT_TRUE((void*) sa.sa_sigaction == (void*) sa.sa_handler);
ASSERT_EQ(static_cast<unsigned>(SA_ONSTACK), sa.sa_flags & ~sa_restorer);
#ifdef SA_RESTORER
ASSERT_EQ(bool(sa.sa_flags & sa_restorer), bool(sa.sa_restorer));
#endif
// Set a new-style sa_sigaction signal handler.
auto no_op_sigaction = [](int, siginfo_t*, void*) {};
@ -317,7 +321,9 @@ static void TestSigAction(int (sigaction_fn)(int, const SigActionT*, SigActionT*
ASSERT_TRUE(sa.sa_sigaction == no_op_sigaction);
ASSERT_TRUE((void*) sa.sa_sigaction == (void*) sa.sa_handler);
ASSERT_EQ(static_cast<unsigned>(SA_ONSTACK | SA_SIGINFO), sa.sa_flags & ~sa_restorer);
#ifdef SA_RESTORER
ASSERT_EQ(bool(sa.sa_flags & sa_restorer), bool(sa.sa_restorer));
#endif
// Put everything back how it was.
ASSERT_EQ(0, sigaction_fn(sig, &original_sa, NULL));