diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-07-15 14:26:59 +0000 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-31 11:02:02 -0700 |
commit | 2e8a07f543e6f48f0d0479e3dd4796c18f733e12 (patch) | |
tree | 14cdb3de964d02948aba6541f0c03fcacca4f63a /configure | |
parent | 0f28c38b34fbfe97a3f0e84871d6dde737b597a9 (diff) |
iproute2: Auto-detect the presence of setns in libc
If libc has setns present use that version instead of
rolling the syscall wrapper by hand.
Dan McGee found the following compile error:
gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include
-DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\" -c -o ipnetns.o ipnetns.c
ipnetns.c:31:12: error: static declaration of ‘setns’ follows non-static
declaration
/usr/include/bits/sched.h:93:12: note: previous declaration of ‘setns’
was here
make[1]: *** [ipnetns.o] Error 1
Reported-by: Dan McGee <dan@archlinux.org>
Tested-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -158,6 +158,27 @@ check_ipt_lib_dir() echo "not found!" } +check_setns() +{ +cat >/tmp/setnstest.c <<EOF +#include <sched.h> +int main(int argc, char **argv) +{ + (void)setns(0,0); + return 0; +} +EOF +gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1 +if [ $? -eq 0 ] +then + echo "IP_CONFIG_SETNS:=y" >>Config + echo "yes" +else + echo "no" +fi +rm -f /tmp/setnstest.c /tmp/setnstest +} + echo "# Generated config based on" $INCLUDE >Config echo "TC schedulers" @@ -173,3 +194,6 @@ check_ipt echo -n "iptables modules directory: " check_ipt_lib_dir + +echo -n "libc has setns: " +check_setns |