From patchwork Fri Jun 22 21:57:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Strachan X-Patchwork-Id: 934130 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="li3/Gr9Q"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DjHF2fZ1z9s3C for ; Mon, 25 Jun 2018 18:38:00 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6DF473E75D7 for ; Mon, 25 Jun 2018 10:37:54 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id D9F233E608A for ; Fri, 22 Jun 2018 23:57:19 +0200 (CEST) Received: from mail-yw0-x249.google.com (mail-yw0-x249.google.com [IPv6:2607:f8b0:4002:c05::249]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 450D610009D9 for ; Fri, 22 Jun 2018 23:57:19 +0200 (CEST) Received: by mail-yw0-x249.google.com with SMTP id 202-v6so4970866ywo.3 for ; Fri, 22 Jun 2018 14:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=GlABiDEm3ifgXrhIjPGFxybPizDf1AgWMrbzsFICAZU=; b=li3/Gr9QolpIlNnTIobYcQpSfnvAHQWvzuGvopPYw9T2eVHYX2jvXrIK6LRygIbhut vEyBTGPUf7tvTFjVAuDkpUN4nbMjvZhm+vfH9UjOSolxduMSF8ntss5CVwSQQT07JxOb H29NQ3aZOdUxGr9TybLVZAPyPlmJobV8PTABB3NuFYZqyRTMEiOfQgpwyhx+IowXMT/k tqozQLlDb49BvQvX5X8r/eTRhwxi0T1tQf2gOf2Teyibq2J3rW4MNTdlXn66Tfwn2pTE Qew9glpSW8FS1BUHoht0WGFMzpK1lMzOEIhb420ggPxL7JOobvwH2nBYyeH7PbymbGbR MTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=GlABiDEm3ifgXrhIjPGFxybPizDf1AgWMrbzsFICAZU=; b=MMH42ua/oF+3LGPpSqb19ahIUOmFLYvLY4ROeT4Tq/axp+TAA9ltW1aJWt7F5dFk1r enw8463wf5m53rEnig9yUNRsHeE/7caAApCdo9FSoEwRLdYLRGeYvDj1GqAjuH6pQPf4 Hptr2FWpMDDGG5X+05zv05Em5S5owP8XyPWAp9cthU55F3IHLn2FE/I4QvqR3L69YtuG xPtd1dworJXKBVP3u6AGJWOt0bVcKincJV3Dhw8hMiFcl8e/HphCDMNXpFgG7ScK8GpB UjG/Cfa7JOVsPKsWQ5azrwW0YHHwi4wSlxTDNE1AuSU8PinrSQ/YGDAiGIhhPS8Rj4WJ qvHw== X-Gm-Message-State: APt69E2NbSSGLmx/ux8UQsikVFL3ODAb70p0zLmMXZ4LmIOrys7YcX9P GdTFh9huB+WqN0o2qOVsvS+x4GJfmG0kZrotnd3GauYagxJHfjioyDkvJXHCtuWzLbGcbF4zrGe XFcJWZHEFsJl/RWJPfw3q8/5QhfSfJXeO7vR2aMeqZ0N8sAF9ee9vR1kQZTAU+eg2 X-Google-Smtp-Source: ADUXVKIR8HUhW8z9wA47FQbyXcfF4nPhzwjkFQMiyOsj7eKOQ0juxd5TONuIVqjO3LgcPLQEMUMV2ezWgqKDzkM= MIME-Version: 1.0 X-Received: by 2002:a25:2493:: with SMTP id k141-v6mr63358ybk.16.1529704637846; Fri, 22 Jun 2018 14:57:17 -0700 (PDT) Date: Fri, 22 Jun 2018 14:57:09 -0700 In-Reply-To: <20180622215710.126661-1-astrachan@google.com> Message-Id: <20180622215710.126661-3-astrachan@google.com> References: <20180622215710.126661-1-astrachan@google.com> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog From: Alistair Strachan To: ltp@lists.linux.it X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-7.4 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it X-Mailman-Approved-At: Mon, 25 Jun 2018 10:37:44 +0200 Cc: kernel-team@android.com Subject: [LTP] [PATCH] {rt_, }sigsuspend01: Fix build for non-glibc platforms X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The tests dig inside the sigset_t to check if the kernel reverted any changes made to the signal mask. This is done by comparing the first 32 signal flag bits by dereferencing the sigset_t and reading __val[0], which is an unsigned long. If the field is not called __val (with Android's bionic it is called '__bits' instead) the build breaks. Change the tests to use memcmp for the first sizeof(unsigned long) bits, which should be equivalent. This makes the test more portable. Signed-off-by: Alistair Strachan --- testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c | 4 +++- testcases/kernel/syscalls/sigsuspend/sigsuspend01.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c index 19e2eb66a..c8c228a47 100644 --- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c +++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "test.h" #include "lapi/syscalls.h" @@ -91,7 +92,8 @@ int main(int ac, char **av) if (TEST_RETURN == -1) { tst_brkm(TFAIL | TTERRNO, cleanup, "rt_sigprocmask failed"); - } else if (set1.__val[0] != set2.__val[0]) { + } else if (memcmp(&set1, &set2, + sizeof(unsigned long))) { tst_brkm(TFAIL | TTERRNO, cleanup, "rt_sigsuspend failed to " "preserve signal mask"); diff --git a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c index b9542e705..a846f6330 100644 --- a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c +++ b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c @@ -121,7 +121,8 @@ int main(int ac, char **av) tst_resm(TFAIL, "sigprocmask() Failed " "to get previous signal mask " "of process"); - } else if (sigset2.__val[0] != sigset1.__val[0]) { + } else if (memcmp(&sigset1, &sigset2, + sizeof(unsigned long))) { tst_resm(TFAIL, "sigsuspend failed to " "preserve signal mask"); } else {