skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 3c8d5a7ca791a847112633c5778badfeb14bf4e8
parent 3af45453ce8370a6a9ba974c8150cb492f1d4b22
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Wed, 23 Aug 2017 08:52:28 +0000

 Change xexecvep exit codes ; add namespaces sysdep

Diffstat:
Mconfigure | 1+
Msrc/libstddjb/xexecvep.c | 3++-
Asrc/sysdeps/trynamespaces.c | 12++++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure b/configure @@ -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 @@ -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 @@ -0,0 +1,12 @@ +/* ISC license. */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include <sched.h> + +int main (void) +{ + return unshare(0) ; +}