Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
16 changes: 16 additions & 0 deletions src/syscall.h
Original file line number Diff line number Diff line change
@@ -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