From patchwork Fri Jul 26 18:25:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 169933 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp390686ilk; Fri, 26 Jul 2019 11:25:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwu2jlZuMivOF6l3uKMcT5QWEJ2mJS4jiXamoH7aDndISdISFrceTXJf5PXKm6UsNiihoqo X-Received: by 2002:a5d:5348:: with SMTP id t8mr27302900wrv.159.1564165549828; Fri, 26 Jul 2019 11:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564165549; cv=none; d=google.com; s=arc-20160816; b=hcTwflSKmQ+nZvh/XOKA09y0BdJsXuqg317SVdX295UsEshBmKEtr1nkXpRz2QXuAs NclqLTdRVNwah4Bzkrr61VLoxVSYKjJw5AzmVfv6rpGQs/AOab2Ky9cLXlEm34o7m/9G wbtRGdqBzf2Ej6MGaJ7F3/Eky+hwWBR4SXpIgZGGCUC51OiPJUnRd4g8PK3c9I0Serug S9nwAQP7s9XNwzDpzaoUwsvZ3E65fttf8/5E9nxJoPO41pbykxFTNaB/eIQIE6zL+FXy CH1jADfQMqwGOmuPadtfyE1m2248ejhO6KUrNS72r48GQ4B9QX5AziwCKlyygIxy1bh2 9QAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=eGccAwP2dqO34Vy58oO66rsNuLWmVORf6lbxL2bAFzI=; b=wF6dNVtsni25vPRBlqA9Za+8D9gEnl+NFcAsYwrz420ZnvWNigsMTrJ/8F/7lWayca pObTwqGJ3tYsNE1Gyh0fhxIbYl5w3ni7XlyqiDP0PkYxZqca5FVmg2XDtnD8MeF7g+ND /Jl+FP7zsCl886KiRCxUwuIAjX9vDwBbu0n2Yg6hNUTP02jUnXtboXgObPFBXR/gxjOR 7kfKuK6WcUuNIRz8OgqgTvhEri8yCVzkp1U/ZmH/26PffoKAlJA3YdBgqQl8kB1L3wo5 IVNbiYCqUZagrbFCh/KQIcGE5/pItWWdnSlaxPEWjz48xPqeWDHWoWKhlCMyjU7YedUt djmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=AgL1Qmqh; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from picard.linux.it (picard.linux.it. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id p14si2014182wrs.256.2019.07.26.11.25.49 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 11:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=AgL1Qmqh; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 375E83C1D37 for ; Fri, 26 Jul 2019 20:25:49 +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 [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 28D453C1CFA for ; Fri, 26 Jul 2019 20:25:44 +0200 (CEST) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (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 460091001D9A for ; Fri, 26 Jul 2019 20:25:30 +0200 (CEST) Received: by mail-pg1-x543.google.com with SMTP id n9so18928783pgc.1 for ; Fri, 26 Jul 2019 11:25:35 -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=I4UqvoT3BDRIJytOvEcEzKDm/K6lrdEYKKvH6s5dgMM=; b=AgL1Qmqhg2omfMVRYhny0k0IuVSm9bQHquLN3zg1TAtvIZCIrAA0gaZtITh1D2NkK1 yFQ/JioD1xBugJd5eTKtUq082EjPPnLMysH2CVLxP8V7QbklMcO4xZkiRw/mrXhA4OIt J02njlCcJaNUzuhZGzL5p2VnrM3A9wDT5CLvjQrJr/1KtOEME9YpLvaLMP2nNXLhJkrx PjdmYtkQWnYS4K9ME8U5SIKobBOdA5yJNdcIlAyHa2W5lplK4FFZ+og7yvRSZQhp21Bi 39U95o3uplWupSNqgcg5vQ23NRFr+S5Lj8LD0jVxLLi/DQJVPVVRFBFqnJO2GAT1nkH6 FS4g== 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=I4UqvoT3BDRIJytOvEcEzKDm/K6lrdEYKKvH6s5dgMM=; b=cKfqyhNufr9OotpsN1xD7zstrcSQT6XLcIXxsPggQnjivWy1T9cjmcWAwIlL9wWPDE kyiI1OKXdBqS6zJC/Xt73/uTbq77fkQpeWJXnJhXyiZ6/8P7EGw3+J81tTgUisCpTFO8 /tiRLDpXxXmTLslNvgYb6b6t/e+l0hoQdKirVO8pfWJHyS96Bi1dl2Yx9ZX0iC8eENjN SMN0+8aEns5dFC4Qn9d8XBNukNFhsmFfzY4ONVEj4E49NIo7asH7s/RYT+C1iSCa5lQU xdNcLet2YHdtz6MS8PHz8v0zkCeGAkbBK4qVuldfCtmne0I/zFtXrcbbz4kxSSPnbq2W MiLQ== X-Gm-Message-State: APjAAAUotl9xi65jYng+lpExK1FjhnLYRMgFcCb1Pk+NbY8ABumKpqKK /JYuhOTw2z3XXIEA6ygGtec9b0Sy+bQ= X-Received: by 2002:a17:90a:2244:: with SMTP id c62mr101733256pje.29.1564165533476; Fri, 26 Jul 2019 11:25:33 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net (c-73-71-176-3.hsd1.ca.comcast.net. [73.71.176.3]) by smtp.gmail.com with ESMTPSA id j20sm51230978pfr.113.2019.07.26.11.25.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 11:25:32 -0700 (PDT) From: Khem Raj To: ltp@lists.linux.it Date: Fri, 26 Jul 2019 11:25:23 -0700 Message-Id: <20190726182524.43149-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.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-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] Add configure time check for getdents/getdents64 APIs X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" glibc 2.30 has added wrapper for getdents64 this will help in detecting right condition to use fallback Check for getdents API as well while here Signed-off-by: Khem Raj --- configure.ac | 2 ++ testcases/kernel/syscalls/getdents/getdents.h | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) -- Mailing list info: https://lists.linux.it/listinfo/ltp --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,8 @@ AC_CHECK_FUNCS([ \ fallocate \ fchownat \ fstatat \ + getdents \ + getdents64 \ kcmp \ mkdirat \ mknodat \ --- a/testcases/kernel/syscalls/getdents/getdents.h +++ b/testcases/kernel/syscalls/getdents/getdents.h @@ -23,7 +23,7 @@ #include #include "test.h" #include "lapi/syscalls.h" - +#include "config.h" /* * See fs/compat.c struct compat_linux_dirent */ @@ -34,12 +34,17 @@ struct linux_dirent { char d_name[]; }; +#if HAVE_GETDENTS +#include +#else static inline int getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) { return ltp_syscall(__NR_getdents, fd, dirp, size); } +#endif /* HAVE_GETDENTS */ + struct linux_dirent64 { uint64_t d_ino; int64_t d_off; @@ -48,10 +53,13 @@ struct linux_dirent64 { char d_name[]; }; +#if HAVE_GETDENTS64 +#include +#else static inline int getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) { return ltp_syscall(__NR_getdents64, fd, dirp64, size); } - +#endif /* HAVE_GETDENTS64 */ #endif /* GETDENTS_H */