From patchwork Mon Jun 17 21:31:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1117498 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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f3p63Qtt"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45SPYb5pFZz9sPp for ; Tue, 18 Jun 2019 07:31:59 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 15D933EB065 for ; Mon, 17 Jun 2019 23:31:51 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 0204E3EA41B for ; Mon, 17 Jun 2019 23:31:48 +0200 (CEST) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id B4A8A600700 for ; Mon, 17 Jun 2019 23:31:45 +0200 (CEST) Received: by mail-wr1-x443.google.com with SMTP id x17so11588359wrl.9 for ; Mon, 17 Jun 2019 14:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pwsuKA5ZBnHl/E946mjscLMLOxjc2e1UFTc9UguSmMg=; b=f3p63QttZaW/gjf0nBw6D5CEf9uOq+/aWZJ2Oj/4EkiiX5aQhBNA8qpU2ejlNgUqSW fXSGt12CLoqL7ml2OsJDxI9DSuS04BnuHNTk418pSKpoL9utHSEVZX1NkYafSbtbc4Mz KF3h7tgVGdn9n2/0Kk51kMEeFpiHxurahXwlTgSvzeblpkcUWj7eL9iVWa3PM4fR1F8V lDWCnp+YIRDTGzASg2pc5W7j+WnKIodoT6oqaT77sItpeQU6fZyNXtm9f98rBlIKhkR8 81HbIL09+7GTCwTIKwkgRPr0kB3K6dXSteceqvk2V4ht5U0bOEK/C0LEgQkk2nYeLx7V +Vgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pwsuKA5ZBnHl/E946mjscLMLOxjc2e1UFTc9UguSmMg=; b=K2BENfrEZbu5+YRDxqxWM4gZr0XeKiL16NAC0LjTCPXkSd9mAZUYJgrP+ZFM0BzlRy BJNyVbdFHrhCT4BR2EVJWY2ONllrQM2rZIgwaBF5HXf0M6WP+oJF6nR6bItuwrMjMYtD cPVbwkXGeFXlKZOuYumyBb8ZajUFp+JkfaGV7+XlPEvZfUtD8HKxHuglcThy6/b8PuZd P9zb2wgu4eX0KMQhPPQb3gK28by1BdFymeFUNDb/xvALYvPhD1pGMQdj8D3d/nzGPL2g Pl75EluYCm4Xepm8gs51U2/inV4Vnvofz+sq2Ilr31RCYIrRzQuHhrSp4agAsJHMQmAY 7JkA== X-Gm-Message-State: APjAAAX+qE5QagjPQxd55cMgayiiosioyweoZycTSzmljVk3yzHvbiFb ts7fmLvAR174q0GFcIaaG2/8sxuU X-Google-Smtp-Source: APXvYqwEs+lDPqnmXHlceExHjdUoM7wtmBpUHszULd0ZrN6CPzIGSGLC0KK55DqNfBPXpezHc9CM2A== X-Received: by 2002:a5d:4286:: with SMTP id k6mr16492624wrq.151.1560807104977; Mon, 17 Jun 2019 14:31:44 -0700 (PDT) Received: from x230.suse.cz ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id y2sm10697111wrl.4.2019.06.17.14.31.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 14:31:44 -0700 (PDT) From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 17 Jun 2019 23:31:38 +0200 Message-Id: <20190617213138.15896-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_HELO_NONE, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] syscalls/ustat: Use __kernel_daddr_t instead of daddr_t 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" This fixes build for musl, which does not have nor typedef daddr_t. Musl does not define these as ustat is deprecated in favor of statfs() and daddr_t is ancient [1]. Other libc also does not have (ustat support was removed from glibc in 2.28), but they have daddr_t. This brings dependency for ustat testing. Typedef is needed as sparc and mips have __kernel_daddr_t long, otherwise it's int. [1] https://www.openwall.com/lists/musl/2019/06/10/1 Signed-off-by: Petr Vorel Reviewed-by: Li Wang --- configure.ac | 1 + include/lapi/ustat.h | 5 +++-- testcases/kernel/syscalls/ustat/ustat01.c | 8 +++++++- testcases/kernel/syscalls/ustat/ustat02.c | 8 +++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 53ad784d7..8ca7e8065 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ AC_CHECK_HEADERS([ \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \ + linux/types.h \ linux/userfaultfd.h \ mm.h \ netinet/sctp.h \ diff --git a/include/lapi/ustat.h b/include/lapi/ustat.h index 12c073582..98633e749 100644 --- a/include/lapi/ustat.h +++ b/include/lapi/ustat.h @@ -9,9 +9,10 @@ #ifdef HAVE_SYS_USTAT_H # include -#else +#elif HAVE_LINUX_TYPES_H +# include struct ustat { - daddr_t f_tfree; + __kernel_daddr_t f_tfree; ino_t f_tinode; char f_fname[6]; char f_fpack[6]; diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c index 2e7dcc9d7..0252858be 100644 --- a/testcases/kernel/syscalls/ustat/ustat01.c +++ b/testcases/kernel/syscalls/ustat/ustat01.c @@ -5,6 +5,10 @@ * Check that ustat() succeeds given correct parameters. */ +#include "config.h" +#include "tst_test.h" + +#if defined(HAVE_SYS_USTAT_H) || defined(HAVE_LINUX_TYPES_H) #include #include #include @@ -12,7 +16,6 @@ #include "lapi/syscalls.h" #include "lapi/ustat.h" -#include "tst_test.h" static dev_t dev_num; @@ -42,3 +45,6 @@ static struct tst_test test = { .test_all = run, .setup = setup, }; +#else +TST_TEST_TCONF("testing ustat requires or "); +#endif diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c index 9bbe4f3f5..4c171f7b8 100644 --- a/testcases/kernel/syscalls/ustat/ustat02.c +++ b/testcases/kernel/syscalls/ustat/ustat02.c @@ -6,6 +6,10 @@ * invalid dev_t parameter and for bad address paramater. */ +#include "config.h" +#include "tst_test.h" + +#if defined(HAVE_SYS_USTAT_H) || defined(HAVE_LINUX_TYPES_H) #include #include #include @@ -13,7 +17,6 @@ #include "lapi/syscalls.h" #include "lapi/ustat.h" -#include "tst_test.h" static dev_t invalid_dev = -1; static dev_t root_dev; @@ -61,3 +64,6 @@ static struct tst_test test = { .setup = setup, .tcnt = ARRAY_SIZE(tc), }; +#else +TST_TEST_TCONF("testing ustat requires or "); +#endif