From: Eugene Loh <[email protected]>
While execveat() appeared in kernel 3.19, GNU C library support
came later. We are still testing on some systems with older libc.
Do not assume libc has an execveat() wrapper: use syscall().
Signed-off-by: Eugene Loh <[email protected]>
---
test/unittest/proc/tst.exec-execveat.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/unittest/proc/tst.exec-execveat.sh b/test/unittest/proc/tst.exec-execveat.sh
index db68a5043..e4b9dfa5e 100755
--- a/test/unittest/proc/tst.exec-execveat.sh
+++ b/test/unittest/proc/tst.exec-execveat.sh
@@ -17,7 +17,7 @@ cd $DIRNAME
cat << EOF > parent.c
#include <stdio.h>
#include <linux/fcntl.h> /* Definition of AT_* constants */
-#define __USE_GNU /* so unistd.h will find execveat */
+#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int main(int c, char **v) {
@@ -26,7 +26,7 @@ int main(int c, char **v) {
int rc;
printf("exec\n");
- rc = execveat(AT_FDCWD, "bogus_direc/bogus_exec", argv, envp, 0);
+ rc = syscall(__NR_execveat, AT_FDCWD, "bogus_direc/bogus_exec", argv, envp, 0);
return 0;
}
--
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.