Use configure script to check setns function

I happen to find out on centos6.7, glibc-headers does have SYS_setns
defined, but previous release doesn't.

It's better to use configure script to check setns function.

Signed-off-by: WANG Chao <wcwxyz@gmail.com>
This commit is contained in:
WANG Chao
2015-12-22 15:58:45 +08:00
parent bfa1af2101
commit 4b6375a4a4
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -32,6 +32,7 @@ AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([dup2 memmove memset mkdir setenv socket strchr strdup strrchr strtoul], [fail=0], [fail=1])
AC_CHECK_FUNCS([setns])
if test "$fail" = "1" ; then
AC_MSG_ERROR(Unable to find necessary functions)
+1 -1
View File
@@ -7,7 +7,7 @@
* requires kernel-headers for syscall number hint.
*/
#if !defined SYS_setns && defined __NR_setns
#if !defined(HAVE_SETNS) && defined(__NR_setns)
static inline int setns(int fd, int nstype)
{
errno = syscall(__NR_setns, fd, nstype);