[systemd-devel] [PATCH] Add setns() functions if not in the C library.

Lennart Poettering lennart at poettering.net
Fri Feb 21 04:59:04 PST 2014

On Fri, 21.02.14 08:28, Holger Schurig (holgerschurig at gmail.com) wrote:

> Compilation works okay here. And "make check" said "PASS: test-namespace".
> > The change I made is to complain if __NR_setns is not defined.
> The approach with an error message (at runtime) was taken from
> iproute2. I used that because for many (desktop) users namespace
> support isn't really needed. So if the libc would really not provide
> it, ... who cares. Then just the namespace related units wouldn't
> work, and they are not central to system bringup.

The behaviour is not too different now, it's now just the kernel that
returns ENOSYS, not userspace. Since setns() has been added in kernel
3.0 (which is the minimum kernel we require) it sounds sensible to
simply define the syscall number

> I didn't knew the syscall numbers differs between architectures. It
> never occured to me that this could be a sane design :-)

It's entirely moronic. It gets even worse when you notice the x86
madness that is socketcall(), where they decided to multiplex all socket
system calls through a single meta-syscall, just because. 


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list