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 */ From patchwork Fri Jul 26 18:25:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 169934 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp390799ilk; Fri, 26 Jul 2019 11:25:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+LKZCwh/JAKe07oywEN+RyyxDVKI1ux+pcT1otKoMxxZQEVHyCGgbL9EQbmHNDr1cyCNM X-Received: by 2002:a1c:d185:: with SMTP id i127mr88945294wmg.63.1564165557271; Fri, 26 Jul 2019 11:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564165557; cv=none; d=google.com; s=arc-20160816; b=g/UVJj187XOLDRQCE4NZMwTlvoBrIlhNg7LKnCa9mpIJRxyvvoe9tQ4V0ciGhFCH5z /n/INUhDU2zHX0XmxjFk9mppZPdlV2tB2KmHP2skRdSE0Mk9DBl2x39L7pufsdUImFLG TSkiHuHEyhGn7Y1DurVJyTht+NQkK6XsgrNChQP8uDkKGV0GDWsxuqQtQh97/EqhnBEK 1fbTLv9vbKK8usGQmc4VvHg5PbdxP1BXB2HxFrAxr3kbEwmUHk/qSijjH8L5evYa5/dW hrpE8ooL/e9x+eKb5jRZXnqAgiWUGsFkNsaV24sJ1XRFwVaUzapZNO53IVqqMBl+nuVd UDcA== 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:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=nABu1U5Uot1ec5vzpEbqSqyjAFOeeJVyV8uWasj6uCw=; b=kvvXwI6GzlQRBtN0RRlAhkw2SOMSVLvoye3DQl6iViu/i8WDaPBX4lGWXLUdOKUJky K8LId8OXbXosZiu1XVkmYVTjhUFPD9zlppc+jA5tzz1ELMB43BOci78OiwnUqexutL9o GTCcKa0CsOuUEumFW9mYQfEHhWi1h5LvgRiwNg7fYxD+ffqCrCS9ABC6KFc15Bx4xPa3 RFf324YNE/3FcFjGMELCJoRFw9hYK2GuUG1QZ38Vb7/+Bsf7zLNb1V4m1a4R0m6EhBnw 2C+iS+EZc45ry/kJkXxA/cMUwtSRkBVZTC3Z3I3yS/d8hItnXUFBES+oiRqCZbmWc2gn pwgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=lmaOCJ3u; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 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. [213.254.12.146]) by mx.google.com with ESMTPS id y16si44178147wrd.418.2019.07.26.11.25.57 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 11:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) client-ip=213.254.12.146; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=lmaOCJ3u; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 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 B89F03C1D2E for ; Fri, 26 Jul 2019 20:25:56 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 805093C1CFA 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-6.smtp.seeweb.it (Postfix) with ESMTPS id E9AB21401B54 for ; Fri, 26 Jul 2019 20:25:35 +0200 (CEST) Received: by mail-pg1-x543.google.com with SMTP id s1so18844767pgr.2 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=u7lt3e9ymEPMzU7/ZOCE+yjkZp0KTJKWEjIqLPlumwo=; b=lmaOCJ3u72MBrCXDKxYZAEMj91PvZ/CMq3Fnjs8P9pOeH9wzpdplb/oM/jOfiWnqkG ZAbV88sAqbw2RX6yaH8dvNpCJ7HHN2l6+Vy+3+wMjLB5OYL89jflay3GCzKqGUW7qV67 74KmyAnLGEz/ytSYKmqhQuBrWEMsBv/Zeappo/8RiS0t+3MJs9x4pUaytGb6RLwRWXGO l8v8v+kmgX8KjLz9F/g670YKxmHpqpYB049qXJDV2km3tvKOZYq+0AQnIjWsT8M3icNu OKLiWUzOD2Qyas6LowkKSPGe5Bcj3xShNMpCJu7GmNgUID1FLlOcNJOUWiXsOAYH3IdX jRRA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=u7lt3e9ymEPMzU7/ZOCE+yjkZp0KTJKWEjIqLPlumwo=; b=fVAGYNYi9SEsQnpiRiqQkZ9GE1J474CRWEtTbtu1Kf+RPV/m/bIyyv/KvY/OI2ZutG fzdu4LXHUbReZiI7/c9KN3nuYEFlAakudb/wfbN7it83zVeMGIbpZuangCVEjRAbFLZB KwJIgpn3vHu2KJQ402iMdaysE5gmaSKDFizFGFVkTc9kR436l3xe0qvcDXzO0DgaQTG3 UDgcOkyGV/KBQJSXhO1rGeal/3m0pvPfJsTN0jP6SmgcE50SW6XO3n+zsdaM40GMapG5 AmFh7yHrNv3NTwO4xsc2VWP9YcBXj2n5VU3L7hYPaMlrAXmDhAEDmzISTywfoNP+19+S YddQ== X-Gm-Message-State: APjAAAUHO2wJLs2hBgxSh5VYfE2wHmkGGxP5bKJu6G1WZmM3XZhDT7km CBlDCxLvu/Kld/X6ulm4hlFY11AzOVs= X-Received: by 2002:a17:90a:d998:: with SMTP id d24mr72031007pjv.89.1564165534105; Fri, 26 Jul 2019 11:25:34 -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.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 11:25:33 -0700 (PDT) From: Khem Raj To: ltp@lists.linux.it Date: Fri, 26 Jul 2019 11:25:24 -0700 Message-Id: <20190726182524.43149-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190726182524.43149-1-raj.khem@gmail.com> References: <20190726182524.43149-1-raj.khem@gmail.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.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-6.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] check for RES_USE_INET6 during configure 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 remove RES_USE_INET6 define which has been on its way out since 2.26 release, this check ensures that we detect it before using it Signed-off-by: Khem Raj --- configure.ac | 13 +++++++++++++ testcases/network/multicast/mc_gethost/mc_gethost.c | 6 ++++++ 2 files changed, 19 insertions(+) -- 2.22.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp diff --git a/configure.ac b/configure.ac index 2255b5c181..ed7acccb01 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,19 @@ AC_CHECK_FUNCS([ \ vmsplice \ ]) +#check defines +AC_MSG_CHECKING([for RES_USE_INET6]) +AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], + [[char dummy[RES_USE_INET6];]])], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 1, [Define to 1 if you have the RES_USE_INET6 macro.]) + ], + [ + AC_MSG_RESULT([no]) + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 0, [Define to 1 if you have the RES_USE_INET6 macro.]) + ] +) # Tools knobs # Expect diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c index 9cc15d086b..d1cae5441a 100644 --- a/testcases/network/multicast/mc_gethost/mc_gethost.c +++ b/testcases/network/multicast/mc_gethost/mc_gethost.c @@ -17,6 +17,8 @@ #include #include +#include "config.h" + #ifndef LOG_PERROR #define LOG_PERROR 0 #endif @@ -50,8 +52,12 @@ usage: argv++, argc--; } if (argc >= 1 && !strcmp(*argv, "-6")) { +#if HAVE_RES_USE_INET6 af = AF_INET6, size = IN6ADDRSZ; _res.options |= RES_USE_INET6; +#else + af = AF_INET, size = INADDRSZ; +#endif argv++, argc--; } if (argc >= 1 && !strcmp(*argv, "-f")) {