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
8dafe6ce
Unverified
Commit
8dafe6ce
authored
Aug 24, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: add compiler.h header
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
97fd1175
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
4 deletions
+43
-4
Makefile.am
src/lxc/Makefile.am
+2
-0
compiler.h
src/lxc/compiler.h
+35
-0
conf.c
src/lxc/conf.c
+1
-1
conf.h
src/lxc/conf.h
+2
-1
initutils.c
src/lxc/initutils.c
+3
-2
No files found.
src/lxc/Makefile.am
View file @
8dafe6ce
...
...
@@ -6,6 +6,7 @@ noinst_HEADERS = attach.h \
caps.h
\
cgroups/cgroup.h
\
cgroups/cgroup_utils.h
\
compiler.h
\
conf.h
\
confile.h
\
confile_utils.h
\
...
...
@@ -86,6 +87,7 @@ liblxc_la_SOURCES = af_unix.c af_unix.h \
cgroups/cgfsng.c
\
cgroups/cgroup.c cgroups/cgroup.h
\
cgroups/cgroup_utils.c cgroups/cgroup_utils.h
\
compiler.h
\
commands.c commands.h
\
commands_utils.c commands_utils.h
\
conf.c conf.h
\
...
...
src/lxc/compiler.h
0 → 100644
View file @
8dafe6ce
/* liblxcapi
*
* Copyright © 2018 Christian Brauner <christian.brauner@ubuntu.com>.
* Copyright © 2018 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __LXC_COMPILER_H
#define __LXC_COMPILER_H
#include "config.h"
#ifndef thread_local
#if __STDC_VERSION__ >= 201112L && \
!(defined(__STDC_NO_THREADS__) || \
(defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16))
#define thread_local _Thread_local
#else
#define thread_local __thread
#endif
#endif
#endif
/* __LXC_COMPILER_H */
src/lxc/conf.c
View file @
8dafe6ce
...
...
@@ -124,7 +124,7 @@ lxc_log_define(conf, lxc);
* This is used in the error calls.
*/
#ifdef HAVE_TLS
__thread
struct
lxc_conf
*
current_config
;
thread_local
struct
lxc_conf
*
current_config
;
#else
struct
lxc_conf
*
current_config
;
#endif
...
...
src/lxc/conf.h
View file @
8dafe6ce
...
...
@@ -38,6 +38,7 @@
#include <sys/resource.h>
#endif
#include "compiler.h"
#include "list.h"
#include "ringbuf.h"
#include "start.h"
/* for lxc_handler */
...
...
@@ -379,7 +380,7 @@ extern int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf,
size_t
buf_size
);
#ifdef HAVE_TLS
extern
__thread
struct
lxc_conf
*
current_config
;
extern
thread_local
struct
lxc_conf
*
current_config
;
#else
extern
struct
lxc_conf
*
current_config
;
#endif
...
...
src/lxc/initutils.c
View file @
8dafe6ce
...
...
@@ -28,6 +28,7 @@
#include "initutils.h"
#include "log.h"
#include "macro.h"
#include "compiler.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
...
...
@@ -72,9 +73,9 @@ const char *lxc_global_config_value(const char *option_name)
/* placed in the thread local storage pool for non-bionic targets */
#ifdef HAVE_TLS
static
__thread
const
char
*
values
[
sizeof
(
options
)
/
sizeof
(
options
[
0
])]
=
{
0
};
static
thread_local
const
char
*
values
[
sizeof
(
options
)
/
sizeof
(
options
[
0
])]
=
{
0
};
#else
static
const
char
*
values
[
sizeof
(
options
)
/
sizeof
(
options
[
0
])]
=
{
0
};
static
const
char
*
values
[
sizeof
(
options
)
/
sizeof
(
options
[
0
])]
=
{
0
};
#endif
/* user_config_path is freed as soon as it is used */
...
...
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