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
d7b58715
Unverified
Commit
d7b58715
authored
Sep 30, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw_syscalls: add lxc_raw_getpid()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
38e5c2db
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
11 deletions
+21
-11
Makefile.am
src/lxc/Makefile.am
+4
-1
af_unix.c
src/lxc/af_unix.c
+1
-0
lxc_init.c
src/lxc/cmd/lxc_init.c
+1
-1
lxc_monitord.c
src/lxc/cmd/lxc_monitord.c
+1
-0
apparmor.c
src/lxc/lsm/apparmor.c
+1
-0
lxccontainer.c
src/lxc/lxccontainer.c
+1
-0
namespace.h
src/lxc/namespace.h
+0
-9
network.c
src/lxc/network.c
+1
-0
raw_syscalls.h
src/lxc/raw_syscalls.h
+10
-0
utils.h
src/lxc/utils.h
+1
-0
No files found.
src/lxc/Makefile.am
View file @
d7b58715
...
...
@@ -342,13 +342,16 @@ if ENABLE_COMMANDS
# Binaries shipping with liblxc
init_lxc_SOURCES
=
cmd/lxc_init.c
\
initutils.c initutils.h
\
raw_syscalls.c raw_syscalls.h
\
string_utils.c string_utils.h
lxc_monitord_SOURCES
=
cmd/lxc_monitord.c
lxc_monitord_SOURCES
=
cmd/lxc_monitord.c
\
raw_syscalls.c raw_syscalls.h
lxc_user_nic_SOURCES
=
cmd/lxc_user_nic.c
\
../include/netns_ifaddrs.c ../include/netns_ifaddrs.h
\
log.c log.h
\
namespace.c namespace.h
\
network.c network.h
\
raw_syscalls.c raw_syscalls.h
\
parse.c parse.h
lxc_usernsexec_SOURCES
=
cmd/lxc_usernsexec.c
\
conf.c conf.h
\
...
...
src/lxc/af_unix.c
View file @
d7b58715
...
...
@@ -37,6 +37,7 @@
#include "config.h"
#include "log.h"
#include "raw_syscalls.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
...
...
src/lxc/cmd/lxc_init.c
View file @
d7b58715
...
...
@@ -46,8 +46,8 @@
#include "error.h"
#include "initutils.h"
#include "log.h"
#include "namespace.h"
#include "parse.h"
#include "raw_syscalls.h"
#include "string_utils.h"
/* option keys for long only options */
...
...
src/lxc/cmd/lxc_monitord.c
View file @
d7b58715
...
...
@@ -49,6 +49,7 @@
#include "log.h"
#include "mainloop.h"
#include "monitor.h"
#include "raw_syscalls.h"
#include "utils.h"
#define CLIENTFDS_CHUNK 64
...
...
src/lxc/lsm/apparmor.c
View file @
d7b58715
...
...
@@ -37,6 +37,7 @@
#include "log.h"
#include "lsm.h"
#include "parse.h"
#include "raw_syscalls.h"
#include "utils.h"
lxc_log_define
(
apparmor
,
lsm
);
...
...
src/lxc/lxccontainer.c
View file @
d7b58715
...
...
@@ -65,6 +65,7 @@
#include "namespace.h"
#include "network.h"
#include "parse.h"
#include "raw_syscalls.h"
#include "start.h"
#include "state.h"
#include "storage.h"
...
...
src/lxc/namespace.h
View file @
d7b58715
...
...
@@ -140,13 +140,4 @@ extern int lxc_namespace_2_ns_idx(const char *namespace);
extern
int
lxc_namespace_2_std_identifiers
(
char
*
namespaces
);
extern
int
lxc_fill_namespace_flags
(
char
*
flaglist
,
int
*
flags
);
/**
* Because of older glibc's pid cache (up to 2.25) whenever clone() is called
* the child must must retrieve it's own pid via lxc_raw_getpid().
*/
static
inline
pid_t
lxc_raw_getpid
(
void
)
{
return
(
pid_t
)
syscall
(
SYS_getpid
);
}
#endif
src/lxc/network.c
View file @
d7b58715
...
...
@@ -56,6 +56,7 @@
#include "macro.h"
#include "network.h"
#include "nl.h"
#include "raw_syscalls.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
...
...
src/lxc/raw_syscalls.h
View file @
d7b58715
...
...
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <unistd.h>
/*
* lxc_raw_clone() - create a new process
...
...
@@ -73,4 +74,13 @@ extern pid_t lxc_raw_clone_cb(int (*fn)(void *), void *args, unsigned long flags
extern
int
lxc_raw_execveat
(
int
dirfd
,
const
char
*
pathname
,
char
*
const
argv
[],
char
*
const
envp
[],
int
flags
);
/*
* Because of older glibc's pid cache (up to 2.25) whenever clone() is called
* the child must must retrieve it's own pid via lxc_raw_getpid().
*/
static
inline
pid_t
lxc_raw_getpid
(
void
)
{
return
(
pid_t
)
syscall
(
SYS_getpid
);
}
#endif
/* __LXC_RAW_SYSCALL_H */
src/lxc/utils.h
View file @
d7b58715
...
...
@@ -40,6 +40,7 @@
#include "file_utils.h"
#include "initutils.h"
#include "macro.h"
#include "raw_syscalls.h"
#include "string_utils.h"
#ifdef HAVE_LINUX_MEMFD_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