From patchwork Tue Oct 8 09:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1173147 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=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46nXFG1D1Kz9s4Y for ; Tue, 8 Oct 2019 20:32:34 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7FF173C12F2 for ; Tue, 8 Oct 2019 11:32:31 +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 346D53C04F9 for ; Tue, 8 Oct 2019 11:32:28 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 0723260065B for ; Tue, 8 Oct 2019 11:32:27 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 67E20AF5D for ; Tue, 8 Oct 2019 09:32:26 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Tue, 8 Oct 2019 11:32:18 +0200 Message-Id: <20191008093218.15801-1-pvorel@suse.cz> X-Mailer: git-send-email 2.23.0 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.0 required=7.0 tests=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] getdents: Fix build under glibc 2.30 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+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" glibc commit b8b3d5a14e ("Linux: Move getdents64 to ") moved the declaration from to to match the location of the declaration in musl. Thus we need to include both and for getdents64(). Using getdents64() declaration requires on both glibc and musl _GNU_SOURCE definition, thus move it to to getdents.h. Fixes: 587 Reported-by: Cyril Hrubis Signed-off-by: Petr Vorel --- Hi, you might not like moving _GNU_SOURCE definition to the header, I can add the missing one in getdents01.c instead. Travis: https://travis-ci.org/pevik/ltp/builds/595021543 Kind regards, Petr testcases/kernel/syscalls/getdents/getdents.h | 2 ++ testcases/kernel/syscalls/getdents/getdents01.c | 3 ++- testcases/kernel/syscalls/getdents/getdents02.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h index c24ed6c99..e43dacc15 100644 --- a/testcases/kernel/syscalls/getdents/getdents.h +++ b/testcases/kernel/syscalls/getdents/getdents.h @@ -20,6 +20,7 @@ #ifndef GETDENTS_H #define GETDENTS_H +#define _GNU_SOURCE #include #include "test.h" #include "lapi/syscalls.h" @@ -54,6 +55,7 @@ struct linux_dirent64 { }; #if HAVE_GETDENTS64 +#include #include #else static inline int diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c index 3962d960b..17a58731d 100644 --- a/testcases/kernel/syscalls/getdents/getdents01.c +++ b/testcases/kernel/syscalls/getdents/getdents01.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "getdents.h" + #include #include #include @@ -27,7 +29,6 @@ #include "test.h" #include "safe_macros.h" -#include "getdents.h" static void cleanup(void); static void setup(void); diff --git a/testcases/kernel/syscalls/getdents/getdents02.c b/testcases/kernel/syscalls/getdents/getdents02.c index 7b023c53f..c45812241 100644 --- a/testcases/kernel/syscalls/getdents/getdents02.c +++ b/testcases/kernel/syscalls/getdents/getdents02.c @@ -33,7 +33,8 @@ * */ -#define _GNU_SOURCE +#include "getdents.h" + #include #include #include @@ -41,7 +42,6 @@ #include #include "test.h" -#include "getdents.h" #include "safe_macros.h" #define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \