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
6b3d24d7
Unverified
Commit
6b3d24d7
authored
Sep 30, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall_wrappers: add pivot_root()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
2a2d77c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
conf.c
src/lxc/conf.c
+1
-15
syscall_wrappers.h
src/lxc/syscall_wrappers.h
+14
-0
No files found.
src/lxc/conf.c
View file @
6b3d24d7
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
#include "start.h"
#include "start.h"
#include "storage.h"
#include "storage.h"
#include "storage/overlay.h"
#include "storage/overlay.h"
#include "syscall_wrappers.h"
#include "terminal.h"
#include "terminal.h"
#include "utils.h"
#include "utils.h"
...
@@ -124,21 +125,6 @@ thread_local struct lxc_conf *current_config;
...
@@ -124,21 +125,6 @@ thread_local struct lxc_conf *current_config;
struct
lxc_conf
*
current_config
;
struct
lxc_conf
*
current_config
;
#endif
#endif
/* Define pivot_root() if missing from the C library */
#ifndef HAVE_PIVOT_ROOT
static
int
pivot_root
(
const
char
*
new_root
,
const
char
*
put_old
)
{
#ifdef __NR_pivot_root
return
syscall
(
__NR_pivot_root
,
new_root
,
put_old
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#else
extern
int
pivot_root
(
const
char
*
new_root
,
const
char
*
put_old
);
#endif
char
*
lxchook_names
[
NUM_LXC_HOOKS
]
=
{
char
*
lxchook_names
[
NUM_LXC_HOOKS
]
=
{
"pre-start"
,
"pre-start"
,
"pre-mount"
,
"pre-mount"
,
...
...
src/lxc/syscall_wrappers.h
View file @
6b3d24d7
...
@@ -48,4 +48,18 @@ static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3,
...
@@ -48,4 +48,18 @@ static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3,
#define keyctl __keyctl
#define keyctl __keyctl
#endif
#endif
#if !HAVE_PIVOT_ROOT
static
int
pivot_root
(
const
char
*
new_root
,
const
char
*
put_old
)
{
#ifdef __NR_pivot_root
return
syscall
(
__NR_pivot_root
,
new_root
,
put_old
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#else
extern
int
pivot_root
(
const
char
*
new_root
,
const
char
*
put_old
);
#endif
#endif
/* __LXC_SYSCALL_WRAPPER_H */
#endif
/* __LXC_SYSCALL_WRAPPER_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