From patchwork Wed Aug 22 01:54:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 960763 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=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41w9b42rsYz9s7T for ; Wed, 22 Aug 2018 11:54:40 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B93AF3E63FC for ; Wed, 22 Aug 2018 03:54:36 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) by picard.linux.it (Postfix) with ESMTP id 6A8503E63B9 for ; Wed, 22 Aug 2018 03:54:34 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-5.smtp.seeweb.it (Postfix) with ESMTP id 1EB3E6002A8 for ; Wed, 22 Aug 2018 03:54:33 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="43761979" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Aug 2018 09:54:32 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 1AD724B6AE0E; Wed, 22 Aug 2018 09:54:32 +0800 (CST) Received: from RHEL7U5Alpha_SERVER.g08.fujitsu.local (10.167.220.156) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 Aug 2018 09:54:32 +0800 From: Xiao Yang To: Date: Wed, 22 Aug 2018 09:54:24 +0800 Message-ID: <1534902864-19343-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1642007852.41615039.1534852963645.JavaMail.zimbra@redhat.com> References: <1642007852.41615039.1534852963645.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.156] X-yoursite-MailScanner-ID: 1AD724B6AE0E.AA95E X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-5.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH v2] syscalls/execveat03: Fix compiler errors 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" According to open(2) and linkat(2) manpages, O_PATH and AT_EMPTY_PATH flags were added since kernel v2.6.39, so these undefined flags led to the following errors on older kernels(e.g. v2.6.32): --------------------------------------------------------- execveat03.c:66: error: ‘O_PATH’ undeclared (first use in this function) execveat03.c:69: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) --------------------------------------------------------- 1) Add AT_EMPTY_PATH into lapi/fcntl.h 2) Include lapi/fcntl.h in execveat03.c Signed-off-by: Xiao Yang --- include/lapi/fcntl.h | 4 ++++ testcases/kernel/syscalls/execveat/execveat03.c | 1 + 2 files changed, 5 insertions(+) diff --git a/include/lapi/fcntl.h b/include/lapi/fcntl.h index 849439d..358230f 100644 --- a/include/lapi/fcntl.h +++ b/include/lapi/fcntl.h @@ -103,6 +103,10 @@ # define AT_SYMLINK_NOFOLLOW 0x100 #endif +#ifndef AT_EMPTY_PATH +# define AT_EMPTY_PATH 0x1000 +#endif + #ifndef AT_REMOVEDIR # define AT_REMOVEDIR 0x200 #endif diff --git a/testcases/kernel/syscalls/execveat/execveat03.c b/testcases/kernel/syscalls/execveat/execveat03.c index df27273..315620b 100644 --- a/testcases/kernel/syscalls/execveat/execveat03.c +++ b/testcases/kernel/syscalls/execveat/execveat03.c @@ -49,6 +49,7 @@ #include #include "tst_test.h" #include "lapi/execveat.h" +#include "lapi/fcntl.h" #define OVL_MNT "ovl" #define TEST_APP "execveat_child"