diff options
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | src/libstddjb/xexecvep.c | 3 | ||||
-rw-r--r-- | src/sysdeps/trynamespaces.c | 12 |
3 files changed, 15 insertions, 1 deletions
@@ -513,6 +513,7 @@ EOF choose cl arc4random_addrandom ARC4RANDOM_ADDRANDOM 'arc4random_addrandom()' choose clr getrandom GETRANDOM 'getrandom()' choose cl itimer ITIMER 'setitimer()' + choose cl namespaces NAMESPACES 'namespaces' echo '#endif' >> $sysdeps/sysdeps.h fi 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 <errno.h> #include <skalibs/djbunix.h> #include <skalibs/strerr2.h> 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 <sched.h> + +int main (void) +{ + return unshare(0) ; +} |