From: Vinson Lee <vlee-xCSkyg8dI+0RB7SZvlqPiA@public.gmane.org>
To: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>,
David Drysdale <drysdale-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Vinson Lee <vlee-1v8oiQdgUNlBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH v2] selftests/exec: Fix build on older distros.
Date: Fri, 26 Jun 2015 16:11:27 -0700 [thread overview]
Message-ID: <1435360289-22531-1-git-send-email-vlee@twopensource.com> (raw)
In-Reply-To: <CAHse=S817frpt-SGVQCWf5Fq3jV3mHdYEkU4XFhu48jkT6CKog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
From: Vinson Lee <vlee-1v8oiQdgUNlBDgjK7y7TUQ@public.gmane.org>
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # 3.19+
Signed-off-by: Vinson Lee <vlee-1v8oiQdgUNlBDgjK7y7TUQ@public.gmane.org>
---
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 <string.h>
#include <unistd.h>
+#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
WARNING: multiple messages have this Message-ID (diff)
From: Vinson Lee <vlee@twopensource.com>
To: Shuah Khan <shuahkh@osg.samsung.com>,
David Drysdale <drysdale@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
Vinson Lee <vlee@twitter.com>
Subject: [PATCH v2] selftests/exec: Fix build on older distros.
Date: Fri, 26 Jun 2015 16:11:27 -0700 [thread overview]
Message-ID: <1435360289-22531-1-git-send-email-vlee@twopensource.com> (raw)
In-Reply-To: <CAHse=S817frpt-SGVQCWf5Fq3jV3mHdYEkU4XFhu48jkT6CKog@mail.gmail.com>
From: Vinson Lee <vlee@twitter.com>
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 <vlee@twitter.com>
---
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 <string.h>
#include <unistd.h>
+#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
next prev parent reply other threads:[~2015-06-26 23:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 23:29 [PATCH] selftests/exec: Fix build on older distros Vinson Lee
2015-06-25 23:29 ` Vinson Lee
[not found] ` <1435274950-17106-1-git-send-email-vlee-xCSkyg8dI+0RB7SZvlqPiA@public.gmane.org>
2015-06-26 6:17 ` David Drysdale
2015-06-26 6:17 ` David Drysdale
[not found] ` <CAHse=S817frpt-SGVQCWf5Fq3jV3mHdYEkU4XFhu48jkT6CKog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-26 23:11 ` Vinson Lee [this message]
2015-06-26 23:11 ` [PATCH v2] " Vinson Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435360289-22531-1-git-send-email-vlee@twopensource.com \
--to=vlee-xcskyg8di+0rb7szvlqpia@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=drysdale-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org \
--cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
--cc=vlee-1v8oiQdgUNlBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.