lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] selftests/exec: Fix build on older distros.
Date
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 | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c
index 8d5d1d2..170148d 100644
--- a/tools/testing/selftests/exec/execveat.c
+++ b/tools/testing/selftests/exec/execveat.c
@@ -20,6 +20,16 @@
#include <string.h>
#include <unistd.h>

+#ifndef AT_EMPTY_PATH
+# define AT_EMPTY_PATH 0x1000
+#endif
+#ifndef O_PATH
+# define O_PATH 010000000
+#endif
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 02000000
+#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


\
 
 \ /
  Last update: 2015-06-26 01:41    [W:0.058 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site