Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 4b6375a

Browse files
committed
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 <[email protected]>
1 parent bfa1af2 commit 4b6375a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ AC_TYPE_UINT8_T
3232
# Checks for library functions.
3333
AC_FUNC_FORK
3434
AC_CHECK_FUNCS([dup2 memmove memset mkdir setenv socket strchr strdup strrchr strtoul], [fail=0], [fail=1])
35+
AC_CHECK_FUNCS([setns])
3536

3637
if test "$fail" = "1" ; then
3738
AC_MSG_ERROR(Unable to find necessary functions)

src/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* requires kernel-headers for syscall number hint.
88
*/
99

10-
#if !defined SYS_setns && defined __NR_setns
10+
#if !defined(HAVE_SETNS) && defined(__NR_setns)
1111
static inline int setns(int fd, int nstype)
1212
{
1313
errno = syscall(__NR_setns, fd, nstype);

0 commit comments

Comments
 (0)