Skip to content
Permalink
Browse files

Support glibc version<2.14 without setns api(centos6)

  • Loading branch information...
faicker authored and eklitzke committed Apr 7, 2017
1 parent ff79abe commit 909b91a32782d12ac88c4467a390915836feae6d
Showing with 16 additions and 0 deletions.
  1. +15 −0 src/netns.h
  2. +1 −0 src/posix.cc
@@ -0,0 +1,15 @@
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 14
/* Define setns() if missing from the C library */
#include <error.h>
static inline int setns(int fd, int nstype)
{
#ifdef __NR_setns
return syscall(__NR_setns, fd, nstype);
#elif defined(__NR_set_ns)
return syscall(__NR_set_ns, fd, nstype);
#else
errno = ENOSYS;
return -1;
#endif
}
#endif
@@ -24,6 +24,7 @@
#include <sstream>

#include "./exc.h"
#include "./netns.h"

namespace pyflame {
int OpenRdonly(const char *path) {

0 comments on commit 909b91a

Please sign in to comment.
You can’t perform that action at this time.