Merge pull request #32 from wcwxyz/master

define setns syscall wrapper to fix build issue
This commit is contained in:
Gao feng
2015-12-07 10:29:15 +08:00
4 changed files with 19 additions and 1 deletions
+1
View File
@@ -17,6 +17,7 @@
#include "util.h"
#include "hyper.h"
#include "parse.h"
#include "syscall.h"
static int container_setup_volume(struct hyper_container *container)
{
+1 -1
View File
@@ -12,11 +12,11 @@
#include <signal.h>
#include <fcntl.h>
#include <inttypes.h>
#include "syscall.h"
#include "hyper.h"
#include "util.h"
#include "parse.h"
#include "syscall.h"
static void pts_hup(struct hyper_event *de, int efd, int out)
{
+1
View File
@@ -27,6 +27,7 @@
#include "event.h"
#include "parse.h"
#include "container.h"
#include "syscall.h"
struct hyper_pod global_pod = {
.containers = LIST_HEAD_INIT(global_pod.containers),
+16
View File
@@ -0,0 +1,16 @@
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
/*
* Use raw syscall for versions of glibc that don't include it. But this
* requires kernel-headers for syscall number hint.
*/
#if !defined SYS_setns && defined __NR_setns
static inline int setns(int fd, int nstype)
{
errno = syscall(__NR_setns, fd, nstype);
return errno == 0 ? 0 : -1;
}
#endif