From 3c8d5a7ca791a847112633c5778badfeb14bf4e8 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 23 Aug 2017 08:52:28 +0000 Subject: Change xexecvep exit codes ; add namespaces sysdep --- src/libstddjb/xexecvep.c | 3 ++- src/sysdeps/trynamespaces.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/sysdeps/trynamespaces.c (limited to 'src') diff --git a/src/libstddjb/xexecvep.c b/src/libstddjb/xexecvep.c index 3a3363e..294f959 100644 --- a/src/libstddjb/xexecvep.c +++ b/src/libstddjb/xexecvep.c @@ -1,10 +1,11 @@ /* ISC license. */ +#include #include #include void xexecvep (char const *file, char const *const *argv, char const *const *envp, char const *path) { execvep(file, argv, envp, path) ; - strerr_dieexec(111, file) ; + strerr_dieexec(errno == ENOENT ? 127 : 126, file) ; } diff --git a/src/sysdeps/trynamespaces.c b/src/sysdeps/trynamespaces.c new file mode 100644 index 0000000..01894be --- /dev/null +++ b/src/sysdeps/trynamespaces.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include + +int main (void) +{ + return unshare(0) ; +} -- cgit v1.2.3