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
e8f764b6
Unverified
Commit
e8f764b6
authored
Oct 03, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall_wrappers: move unshare()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
364932cf
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
15 deletions
+21
-15
Makefile.am
src/lxc/Makefile.am
+1
-0
lxc_usernsexec.c
src/lxc/cmd/lxc_usernsexec.c
+1
-0
criu.c
src/lxc/criu.c
+1
-0
lxccontainer.c
src/lxc/lxccontainer.c
+1
-0
rsync.c
src/lxc/storage/rsync.c
+1
-0
storage_utils.c
src/lxc/storage/storage_utils.c
+1
-0
syscall_wrappers.h
src/lxc/syscall_wrappers.h
+15
-0
utils.h
src/lxc/utils.h
+0
-15
No files found.
src/lxc/Makefile.am
View file @
e8f764b6
...
@@ -369,6 +369,7 @@ lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
...
@@ -369,6 +369,7 @@ lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
macro.h
\
macro.h
\
file_utils.c file_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
\
string_utils.c string_utils.h
\
syscall_wrappers.h
\
utils.c utils.h
utils.c utils.h
endif
endif
...
...
src/lxc/cmd/lxc_usernsexec.c
View file @
e8f764b6
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
#include "macro.h"
#include "macro.h"
#include "file_utils.h"
#include "file_utils.h"
#include "string_utils.h"
#include "string_utils.h"
#include "syscall_wrappers.h"
#include "utils.h"
#include "utils.h"
extern
int
lxc_log_fd
;
extern
int
lxc_log_fd
;
...
...
src/lxc/criu.c
View file @
e8f764b6
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "lxclock.h"
#include "lxclock.h"
#include "network.h"
#include "network.h"
#include "storage.h"
#include "storage.h"
#include "syscall_wrappers.h"
#include "utils.h"
#include "utils.h"
#if IS_BIONIC
#if IS_BIONIC
...
...
src/lxc/lxccontainer.c
View file @
e8f764b6
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#include "storage/overlay.h"
#include "storage/overlay.h"
#include "storage_utils.h"
#include "storage_utils.h"
#include "sync.h"
#include "sync.h"
#include "syscall_wrappers.h"
#include "terminal.h"
#include "terminal.h"
#include "utils.h"
#include "utils.h"
#include "version.h"
#include "version.h"
...
...
src/lxc/storage/rsync.c
View file @
e8f764b6
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include "log.h"
#include "log.h"
#include "rsync.h"
#include "rsync.h"
#include "storage.h"
#include "storage.h"
#include "syscall_wrappers.h"
#include "utils.h"
#include "utils.h"
lxc_log_define
(
rsync
,
lxc
);
lxc_log_define
(
rsync
,
lxc
);
...
...
src/lxc/storage/storage_utils.c
View file @
e8f764b6
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include "parse.h"
#include "parse.h"
#include "storage.h"
#include "storage.h"
#include "storage_utils.h"
#include "storage_utils.h"
#include "syscall_wrappers.h"
#include "utils.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
#ifndef HAVE_STRLCPY
...
...
src/lxc/syscall_wrappers.h
View file @
e8f764b6
...
@@ -155,4 +155,19 @@ static inline int setns(int fd, int nstype)
...
@@ -155,4 +155,19 @@ static inline int setns(int fd, int nstype)
}
}
#endif
#endif
/* Define unshare() if missing from the C library */
#ifndef HAVE_UNSHARE
static
inline
int
unshare
(
int
flags
)
{
#ifdef __NR_unshare
return
syscall
(
__NR_unshare
,
flags
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#else
extern
int
unshare
(
int
);
#endif
#endif
/* __LXC_SYSCALL_WRAPPER_H */
#endif
/* __LXC_SYSCALL_WRAPPER_H */
src/lxc/utils.h
View file @
e8f764b6
...
@@ -56,21 +56,6 @@ extern char *get_rundir(void);
...
@@ -56,21 +56,6 @@ extern char *get_rundir(void);
#endif
#endif
#endif
#endif
/* Define unshare() if missing from the C library */
#ifndef HAVE_UNSHARE
static
inline
int
unshare
(
int
flags
)
{
#ifdef __NR_unshare
return
syscall
(
__NR_unshare
,
flags
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#else
extern
int
unshare
(
int
);
#endif
/* Define signalfd() if missing from the C library */
/* Define signalfd() if missing from the C library */
#ifdef HAVE_SYS_SIGNALFD_H
#ifdef HAVE_SYS_SIGNALFD_H
# include <sys/signalfd.h>
# include <sys/signalfd.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