Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
61068d39
Unverified
Commit
61068d39
authored
Apr 26, 2018
by
Christian Brauner
Committed by
GitHub
Apr 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2293 from pkun/master
Fix tool_utils.c build when HAVE_SETNS is unset
parents
fca96eb6
09e6e41e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
tool_utils.h
src/lxc/tools/tool_utils.h
+33
-0
No files found.
src/lxc/tools/tool_utils.h
View file @
61068d39
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
/* Properly support loop devices on 32bit systems. */
/* Properly support loop devices on 32bit systems. */
#define _FILE_OFFSET_BITS 64
#define _FILE_OFFSET_BITS 64
#include "config.h"
#include <errno.h>
#include <errno.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -109,6 +111,37 @@ extern signed long lxc_config_parse_arch(const char *arch);
...
@@ -109,6 +111,37 @@ extern signed long lxc_config_parse_arch(const char *arch);
extern
int
lxc_namespace_2_cloneflag
(
const
char
*
namespace
);
extern
int
lxc_namespace_2_cloneflag
(
const
char
*
namespace
);
extern
int
lxc_fill_namespace_flags
(
char
*
flaglist
,
int
*
flags
);
extern
int
lxc_fill_namespace_flags
(
char
*
flaglist
,
int
*
flags
);
#if !defined(__NR_setns) && !defined(__NR_set_ns)
#if defined(__x86_64__)
#define __NR_setns 308
#elif defined(__i386__)
#define __NR_setns 346
#elif defined(__arm__)
#define __NR_setns 375
#elif defined(__aarch64__)
#define __NR_setns 375
#elif defined(__powerpc__)
#define __NR_setns 350
#elif defined(__s390__)
#define __NR_setns 339
#endif
#endif
/* Define setns() if missing from the C library */
#ifndef HAVE_SETNS
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
#if HAVE_LIBCAP
#if HAVE_LIBCAP
#include <sys/capability.h>
#include <sys/capability.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment