From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinson Lee Subject: [PATCH v2] selftests/exec: Fix build on older distros. Date: Fri, 26 Jun 2015 16:11:27 -0700 Message-ID: <1435360289-22531-1-git-send-email-vlee@twopensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Shuah Khan , David Drysdale , Andrew Morton , Geert Uytterhoeven , Michael Ellerman Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Vinson Lee List-Id: linux-api@vger.kernel.org =46rom: Vinson Lee This patch fixes this build error on CentOS 5. execveat.c: In function =E2=80=98check_execveat_pathmax=E2=80=99: execveat.c:185: error: =E2=80=98AT_EMPTY_PATH=E2=80=99 undeclared (firs= t use in this function) execveat.c:185: error: (Each undeclared identifier is reported only onc= e execveat.c:185: error: for each function it appears in.) execveat.c: In function =E2=80=98run_tests=E2=80=99: execveat.c:221: error: =E2=80=98O_PATH=E2=80=99 undeclared (first use i= n this function) execveat.c:222: error: =E2=80=98O_CLOEXEC=E2=80=99 undeclared (first us= e in this function) execveat.c:258: error: =E2=80=98AT_EMPTY_PATH=E2=80=99 undeclared (firs= t use in this function) Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # 3.19+ Signed-off-by: Vinson Lee --- tools/testing/selftests/exec/execveat.c | 34 +++++++++++++++++++++++++= ++++++++ 1 file changed, 34 insertions(+) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/se= lftests/exec/execveat.c index 8d5d1d2..30d2555 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c @@ -20,6 +20,40 @@ #include #include =20 +#if defined( __alpha__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 010000000 +# endif +# ifndef O_PATH +# define O_PATH 040000000 +# endif +#elif defined(__hppa__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 010000000 +# endif +# ifndef O_PATH +# define O_PATH 020000000 +# endif +#elif defined(__sparc__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 0x400000 +# endif +# ifndef O_PATH +# define O_PATH 0x1000000 +# endif +#else +# ifndef O_CLOEXEC +# define O_CLOEXEC 02000000 +# endif +# ifndef O_PATH +# define O_PATH 010000000 +# endif +#endif + +#ifndef AT_EMPTY_PATH +# define AT_EMPTY_PATH 0x1000 +#endif + static char longpath[2 * PATH_MAX] =3D ""; static char *envp[] =3D { "IN_TEST=3Dyes", NULL, NULL }; static char *argv[] =3D { "execveat", "99", NULL }; --=20 1.8.2.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbbFZXLm (ORCPT ); Fri, 26 Jun 2015 19:11:42 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36540 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbbFZXLf (ORCPT ); Fri, 26 Jun 2015 19:11:35 -0400 From: Vinson Lee To: Shuah Khan , David Drysdale , Andrew Morton , Geert Uytterhoeven , Michael Ellerman Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Vinson Lee Subject: [PATCH v2] selftests/exec: Fix build on older distros. Date: Fri, 26 Jun 2015 16:11:27 -0700 Message-Id: <1435360289-22531-1-git-send-email-vlee@twopensource.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinson Lee This patch fixes this build error on CentOS 5. execveat.c: In function ‘check_execveat_pathmax’: execveat.c:185: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) execveat.c:185: error: (Each undeclared identifier is reported only once execveat.c:185: error: for each function it appears in.) execveat.c: In function ‘run_tests’: execveat.c:221: error: ‘O_PATH’ undeclared (first use in this function) execveat.c:222: error: ‘O_CLOEXEC’ undeclared (first use in this function) execveat.c:258: error: ‘AT_EMPTY_PATH’ undeclared (first use in this function) Cc: stable@vger.kernel.org # 3.19+ Signed-off-by: Vinson Lee --- tools/testing/selftests/exec/execveat.c | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index 8d5d1d2..30d2555 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c @@ -20,6 +20,40 @@ #include #include +#if defined( __alpha__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 010000000 +# endif +# ifndef O_PATH +# define O_PATH 040000000 +# endif +#elif defined(__hppa__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 010000000 +# endif +# ifndef O_PATH +# define O_PATH 020000000 +# endif +#elif defined(__sparc__) +# ifndef O_CLOEXEC +# define O_CLOEXEC 0x400000 +# endif +# ifndef O_PATH +# define O_PATH 0x1000000 +# endif +#else +# ifndef O_CLOEXEC +# define O_CLOEXEC 02000000 +# endif +# ifndef O_PATH +# define O_PATH 010000000 +# endif +#endif + +#ifndef AT_EMPTY_PATH +# define AT_EMPTY_PATH 0x1000 +#endif + static char longpath[2 * PATH_MAX] = ""; static char *envp[] = { "IN_TEST=yes", NULL, NULL }; static char *argv[] = { "execveat", "99", NULL }; -- 1.8.2.1