setns syscall via syscall()
setns syscall via syscall()
Posted Jan 18, 2013 9:15 UTC (Fri) by bourbaki (guest, #84259)Parent article: Namespaces in operation, part 2: the namespaces API
If your libc is too old and and does not have the setns() wrapper for the sys_setns syscall, you can use the syscall() function instead (in <sys/syscall.h>).
On x86_64, the sys_setns syscall number is 308, so in ns_exec.c you can do :
syscall(308,fd,0)
instead of
setns(fd,0)