|
|
Subscribe / Log in / New account

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)


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds