New libcs may have unshare but old ones do not. Make a "weak" definition which will defer to libc. Signed-off-by: Matt Helsley <matthltc@xxxxxxxxxx> --- nsexec.c | 5 +++++ test/ipcshm_multi.c | 6 ++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/nsexec.c b/nsexec.c index 1cf9c97..a9ed016 100644 --- a/nsexec.c +++ b/nsexec.c @@ -27,6 +27,11 @@ extern pid_t getsid(pid_t pid); static const char* procname; +int __attribute__((weak)) unshare(int flags) +{ + return syscall(__NR_unshare, flags); +} + static void usage(const char *name) { printf("usage: %s [-h] [-c] [-mnuUip] [-P <pid-file>]" diff --git a/test/ipcshm_multi.c b/test/ipcshm_multi.c index ff3712f..da37feb 100644 --- a/test/ipcshm_multi.c +++ b/test/ipcshm_multi.c @@ -13,6 +13,12 @@ /* For CLONE_NEWIPC */ #include "../clone.h" +int __attribute__((weak)) unshare(int flags) +{ + return syscall(__NR_unshare, flags); +} + + #define OUTFILE "/tmp/cr-test.out" #define SEG_SIZE (20 * 4096) #define DELAY 20 -- 1.6.3.3 _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers