The setns syscall is now mainstream but the parameter passing changed.
Let's fix that.
The pid namespace and mount namespace attach are missing for the moment.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
void *arg;
};
-int setns(int nstype, int fd)
+int setns(int fd, int nstype)
{
#ifndef __NR_setns
errno = ENOSYS;
return -1;
#else
- return syscall(__NR_setns, nstype, fd);
+ return syscall(__NR_setns, fd, nstype);
#endif
}
}
for (i = 0; i < size; i++) {
- if (setns(0, fd[i])) {
+ if (setns(fd[i], 0)) {
SYSERROR("failed to set namespace '%s'", ns[i]);
return -1;
}