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
4a9ee78a
Unverified
Commit
4a9ee78a
authored
Jul 20, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file_utils: hide unnecessary symbols
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a10ce5a8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
55 deletions
+100
-55
Makefile.am
src/lxc/Makefile.am
+25
-1
file_utils.h
src/lxc/file_utils.h
+40
-50
Makefile.am
src/tests/Makefile.am
+35
-4
No files found.
src/lxc/Makefile.am
View file @
4a9ee78a
...
@@ -336,6 +336,7 @@ lxc_attach_SOURCES = tools/lxc_attach.c \
...
@@ -336,6 +336,7 @@ lxc_attach_SOURCES = tools/lxc_attach.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
rexec.c rexec.h
\
rexec.c rexec.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_autostart_SOURCES
=
tools/lxc_autostart.c
\
lxc_autostart_SOURCES
=
tools/lxc_autostart.c
\
...
@@ -345,6 +346,7 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \
...
@@ -345,6 +346,7 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_cgroup_SOURCES
=
tools/lxc_cgroup.c
\
lxc_cgroup_SOURCES
=
tools/lxc_cgroup.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -353,6 +355,7 @@ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
...
@@ -353,6 +355,7 @@ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_config_SOURCES
=
tools/lxc_config.c
\
lxc_config_SOURCES
=
tools/lxc_config.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -361,6 +364,7 @@ lxc_config_SOURCES = tools/lxc_config.c \
...
@@ -361,6 +364,7 @@ lxc_config_SOURCES = tools/lxc_config.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_console_SOURCES
=
tools/lxc_console.c
\
lxc_console_SOURCES
=
tools/lxc_console.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -369,6 +373,7 @@ lxc_console_SOURCES = tools/lxc_console.c \
...
@@ -369,6 +373,7 @@ lxc_console_SOURCES = tools/lxc_console.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_destroy_SOURCES
=
tools/lxc_destroy.c
\
lxc_destroy_SOURCES
=
tools/lxc_destroy.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -377,6 +382,7 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c \
...
@@ -377,6 +382,7 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_device_SOURCES
=
tools/lxc_device.c
\
lxc_device_SOURCES
=
tools/lxc_device.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -385,6 +391,7 @@ lxc_device_SOURCES = tools/lxc_device.c \
...
@@ -385,6 +391,7 @@ lxc_device_SOURCES = tools/lxc_device.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_execute_SOURCES
=
tools/lxc_execute.c
\
lxc_execute_SOURCES
=
tools/lxc_execute.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -393,6 +400,7 @@ lxc_execute_SOURCES = tools/lxc_execute.c \
...
@@ -393,6 +400,7 @@ lxc_execute_SOURCES = tools/lxc_execute.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_freeze_SOURCES
=
tools/lxc_freeze.c
\
lxc_freeze_SOURCES
=
tools/lxc_freeze.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -401,6 +409,7 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \
...
@@ -401,6 +409,7 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_info_SOURCES
=
tools/lxc_info.c
\
lxc_info_SOURCES
=
tools/lxc_info.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -409,6 +418,7 @@ lxc_info_SOURCES = tools/lxc_info.c \
...
@@ -409,6 +418,7 @@ lxc_info_SOURCES = tools/lxc_info.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_monitor_SOURCES
=
tools/lxc_monitor.c
\
lxc_monitor_SOURCES
=
tools/lxc_monitor.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -417,6 +427,7 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c \
...
@@ -417,6 +427,7 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
macro.h
\
macro.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_ls_SOURCES
=
tools/lxc_ls.c
\
lxc_ls_SOURCES
=
tools/lxc_ls.c
\
...
@@ -426,6 +437,7 @@ lxc_ls_SOURCES = tools/lxc_ls.c \
...
@@ -426,6 +437,7 @@ lxc_ls_SOURCES = tools/lxc_ls.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
memory_utils.h
\
memory_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_copy_SOURCES
=
tools/lxc_copy.c
\
lxc_copy_SOURCES
=
tools/lxc_copy.c
\
...
@@ -435,6 +447,7 @@ lxc_copy_SOURCES = tools/lxc_copy.c \
...
@@ -435,6 +447,7 @@ lxc_copy_SOURCES = tools/lxc_copy.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
storage/storage_utils.c storage/storage_utils.h
\
storage/storage_utils.c storage/storage_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_start_SOURCES
=
tools/lxc_start.c
\
lxc_start_SOURCES
=
tools/lxc_start.c
\
...
@@ -444,6 +457,7 @@ lxc_start_SOURCES = tools/lxc_start.c \
...
@@ -444,6 +457,7 @@ lxc_start_SOURCES = tools/lxc_start.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_stop_SOURCES
=
tools/lxc_stop.c
\
lxc_stop_SOURCES
=
tools/lxc_stop.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -452,6 +466,7 @@ lxc_stop_SOURCES = tools/lxc_stop.c \
...
@@ -452,6 +466,7 @@ lxc_stop_SOURCES = tools/lxc_stop.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_top_SOURCES
=
tools/lxc_top.c
\
lxc_top_SOURCES
=
tools/lxc_top.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -460,6 +475,7 @@ lxc_top_SOURCES = tools/lxc_top.c \
...
@@ -460,6 +475,7 @@ lxc_top_SOURCES = tools/lxc_top.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_unfreeze_SOURCES
=
tools/lxc_unfreeze.c
\
lxc_unfreeze_SOURCES
=
tools/lxc_unfreeze.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -468,6 +484,7 @@ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
...
@@ -468,6 +484,7 @@ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_unshare_SOURCES
=
tools/lxc_unshare.c
\
lxc_unshare_SOURCES
=
tools/lxc_unshare.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -476,6 +493,7 @@ lxc_unshare_SOURCES = tools/lxc_unshare.c \
...
@@ -476,6 +493,7 @@ lxc_unshare_SOURCES = tools/lxc_unshare.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
\
string_utils.c string_utils.h
\
syscall_numbers.h
\
syscall_numbers.h
\
syscall_wrappers.h
syscall_wrappers.h
...
@@ -486,6 +504,7 @@ lxc_wait_SOURCES = tools/lxc_wait.c \
...
@@ -486,6 +504,7 @@ lxc_wait_SOURCES = tools/lxc_wait.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_create_SOURCES
=
tools/lxc_create.c
\
lxc_create_SOURCES
=
tools/lxc_create.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -494,6 +513,7 @@ lxc_create_SOURCES = tools/lxc_create.c \
...
@@ -494,6 +513,7 @@ lxc_create_SOURCES = tools/lxc_create.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
storage/storage_utils.c storage/storage_utils.h
\
storage/storage_utils.c storage/storage_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_snapshot_SOURCES
=
tools/lxc_snapshot.c
\
lxc_snapshot_SOURCES
=
tools/lxc_snapshot.c
\
...
@@ -503,6 +523,7 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
...
@@ -503,6 +523,7 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
lxc_checkpoint_SOURCES
=
tools/lxc_checkpoint.c
\
lxc_checkpoint_SOURCES
=
tools/lxc_checkpoint.c
\
tools/arguments.c tools/arguments.h
\
tools/arguments.c tools/arguments.h
\
...
@@ -511,6 +532,7 @@ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
...
@@ -511,6 +532,7 @@ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
string_utils.c string_utils.h
endif
endif
...
@@ -520,6 +542,7 @@ init_lxc_SOURCES = cmd/lxc_init.c \
...
@@ -520,6 +542,7 @@ init_lxc_SOURCES = cmd/lxc_init.c \
compiler.h
\
compiler.h
\
error.c error.h
\
error.c error.h
\
initutils.c initutils.h
\
initutils.c initutils.h
\
file_utils.c file_utils.h
\
memory_utils.h
\
memory_utils.h
\
parse.c parse.h
\
parse.c parse.h
\
process_utils.c process_utils.h
\
process_utils.c process_utils.h
\
...
@@ -534,6 +557,7 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \
...
@@ -534,6 +557,7 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
log.c log.h
\
log.c log.h
\
mainloop.c mainloop.h
\
mainloop.c mainloop.h
\
monitor.c monitor.h
\
monitor.c monitor.h
\
...
@@ -548,6 +572,7 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
...
@@ -548,6 +572,7 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
conf.c conf.h
\
conf.c conf.h
\
confile.c confile.h
\
confile.c confile.h
\
confile_utils.c confile_utils.h
\
confile_utils.c confile_utils.h
\
file_utils.c file_utils.h
\
log.c log.h
\
log.c log.h
\
memory_utils.h
\
memory_utils.h
\
network.c network.h
\
network.c network.h
\
...
@@ -555,7 +580,6 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
...
@@ -555,7 +580,6 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
parse.c parse.h
\
parse.c parse.h
\
process_utils.c process_utils.h
\
process_utils.c process_utils.h
\
syscall_numbers.h
\
syscall_numbers.h
\
file_utils.c file_utils.h
\
string_utils.c string_utils.h
\
string_utils.c string_utils.h
\
syscall_wrappers.h
syscall_wrappers.h
lxc_usernsexec_SOURCES
=
cmd/lxc_usernsexec.c
\
lxc_usernsexec_SOURCES
=
cmd/lxc_usernsexec.c
\
...
...
src/lxc/file_utils.h
View file @
4a9ee78a
...
@@ -15,73 +15,63 @@
...
@@ -15,73 +15,63 @@
#include "compiler.h"
#include "compiler.h"
/* read and write whole files */
/* read and write whole files */
extern
int
lxc_write_to_file
(
const
char
*
filename
,
const
void
*
buf
,
__hidden
extern
int
lxc_write_to_file
(
const
char
*
filename
,
const
void
*
buf
,
size_t
count
,
size_t
count
,
bool
add_newline
,
mode_t
mode
)
bool
add_newline
,
mode_t
mode
)
__access_r
(
2
,
3
);
__access_r
(
2
,
3
);
extern
int
lxc_readat
(
int
dirfd
,
const
char
*
filename
,
void
*
buf
,
size_t
count
)
__hidden
extern
int
lxc_readat
(
int
dirfd
,
const
char
*
filename
,
void
*
buf
,
size_t
count
)
__access_w
(
3
,
4
);
__access_w
(
3
,
4
);
extern
int
lxc_writeat
(
int
dirfd
,
const
char
*
filename
,
const
void
*
buf
,
__hidden
extern
int
lxc_writeat
(
int
dirfd
,
const
char
*
filename
,
const
void
*
buf
,
size_t
count
)
size_t
count
)
__access_r
(
3
,
4
);
__access_r
(
3
,
4
);
extern
int
lxc_write_openat
(
const
char
*
dir
,
const
char
*
filename
,
__hidden
extern
int
lxc_write_openat
(
const
char
*
dir
,
const
char
*
filename
,
const
void
*
buf
,
const
void
*
buf
,
size_t
count
)
size_t
count
)
__access_r
(
3
,
4
);
__access_r
(
3
,
4
);
extern
int
lxc_read_from_file
(
const
char
*
filename
,
void
*
buf
,
size_t
count
)
__hidden
extern
int
lxc_read_from_file
(
const
char
*
filename
,
void
*
buf
,
size_t
count
)
__access_w
(
2
,
3
);
__access_w
(
2
,
3
);
/* send and receive buffers completely */
/* send and receive buffers completely */
extern
ssize_t
lxc_write_nointr
(
int
fd
,
const
void
*
buf
,
size_t
count
)
__hidden
extern
ssize_t
lxc_write_nointr
(
int
fd
,
const
void
*
buf
,
size_t
count
)
__access_r
(
2
,
3
);
__access_r
(
2
,
3
);
extern
ssize_t
lxc_pwrite_nointr
(
int
fd
,
const
void
*
buf
,
size_t
count
,
__hidden
extern
ssize_t
lxc_pwrite_nointr
(
int
fd
,
const
void
*
buf
,
size_t
count
,
off_t
offset
)
off_t
offset
)
__access_r
(
2
,
3
);
__access_r
(
2
,
3
);
extern
ssize_t
lxc_send_nointr
(
int
sockfd
,
void
*
buf
,
size_t
len
,
int
flags
)
__hidden
extern
ssize_t
lxc_send_nointr
(
int
sockfd
,
void
*
buf
,
size_t
len
,
int
flags
)
__access_r
(
2
,
3
);
__access_r
(
2
,
3
);
extern
ssize_t
lxc_read_nointr
(
int
fd
,
void
*
buf
,
size_t
count
)
__hidden
extern
ssize_t
lxc_read_nointr
(
int
fd
,
void
*
buf
,
size_t
count
)
__access_w
(
2
,
3
);
__access_w
(
2
,
3
);
extern
ssize_t
lxc_read_nointr_expect
(
int
fd
,
void
*
buf
,
size_t
count
,
__hidden
extern
ssize_t
lxc_read_nointr_expect
(
int
fd
,
void
*
buf
,
size_t
count
,
const
void
*
expected_buf
)
const
void
*
expected_buf
)
__access_w
(
2
,
3
);
__access_w
(
2
,
3
);
extern
ssize_t
lxc_read_file_expect
(
const
char
*
path
,
void
*
buf
,
size_t
count
,
__hidden
extern
ssize_t
lxc_read_file_expect
(
const
char
*
path
,
void
*
buf
,
size_t
count
,
const
void
*
expected_buf
)
const
void
*
expected_buf
)
__access_w
(
2
,
3
);
__access_w
(
2
,
3
);
extern
ssize_t
lxc_recv_nointr
(
int
sockfd
,
void
*
buf
,
size_t
len
,
int
flags
)
__hidden
extern
ssize_t
lxc_recv_nointr
(
int
sockfd
,
void
*
buf
,
size_t
len
,
int
flags
)
__access_w
(
2
,
3
);
__access_w
(
2
,
3
);
ssize_t
lxc_recvmsg_nointr_iov
(
int
sockfd
,
struct
iovec
*
iov
,
size_t
iovlen
,
__hidden
extern
ssize_t
lxc_recvmsg_nointr_iov
(
int
sockfd
,
struct
iovec
*
iov
,
size_t
iovlen
,
int
flags
);
int
flags
);
extern
bool
file_exists
(
const
char
*
f
);
__hidden
extern
bool
file_exists
(
const
char
*
f
);
extern
int
print_to_file
(
const
char
*
file
,
const
char
*
content
);
__hidden
extern
int
print_to_file
(
const
char
*
file
,
const
char
*
content
);
extern
int
is_dir
(
const
char
*
path
);
__hidden
extern
int
is_dir
(
const
char
*
path
);
extern
int
lxc_count_file_lines
(
const
char
*
fn
);
__hidden
extern
int
lxc_count_file_lines
(
const
char
*
fn
);
extern
int
lxc_make_tmpfile
(
char
*
template
,
bool
rm
);
__hidden
extern
int
lxc_make_tmpfile
(
char
*
template
,
bool
rm
);
/* __typeof__ should be safe to use with all compilers. */
/* __typeof__ should be safe to use with all compilers. */
typedef
__typeof__
(((
struct
statfs
*
)
NULL
)
->
f_type
)
fs_type_magic
;
typedef
__typeof__
(((
struct
statfs
*
)
NULL
)
->
f_type
)
fs_type_magic
;
extern
bool
has_fs_type
(
const
char
*
path
,
fs_type_magic
magic_val
);
__hidden
extern
bool
has_fs_type
(
const
char
*
path
,
fs_type_magic
magic_val
);
extern
bool
fhas_fs_type
(
int
fd
,
fs_type_magic
magic_val
);
__hidden
extern
bool
fhas_fs_type
(
int
fd
,
fs_type_magic
magic_val
);
extern
bool
is_fs_type
(
const
struct
statfs
*
fs
,
fs_type_magic
magic_val
);
__hidden
extern
bool
is_fs_type
(
const
struct
statfs
*
fs
,
fs_type_magic
magic_val
);
extern
FILE
*
fopen_cloexec
(
const
char
*
path
,
const
char
*
mode
);
__hidden
extern
FILE
*
fopen_cloexec
(
const
char
*
path
,
const
char
*
mode
);
extern
ssize_t
lxc_sendfile_nointr
(
int
out_fd
,
int
in_fd
,
off_t
*
offset
,
__hidden
extern
ssize_t
lxc_sendfile_nointr
(
int
out_fd
,
int
in_fd
,
off_t
*
offset
,
size_t
count
);
size_t
count
);
__hidden
extern
char
*
file_to_buf
(
const
char
*
path
,
size_t
*
length
);
extern
char
*
file_to_buf
(
const
char
*
path
,
size_t
*
length
);
__hidden
extern
int
fd_to_buf
(
int
fd
,
char
**
buf
,
size_t
*
length
);
extern
int
fd_to_buf
(
int
fd
,
char
**
buf
,
size_t
*
length
);
__hidden
extern
int
fd_to_fd
(
int
from
,
int
to
);
extern
int
fd_to_fd
(
int
from
,
int
to
);
__hidden
extern
int
lxc_open_dirfd
(
const
char
*
dir
);
extern
int
lxc_open_dirfd
(
const
char
*
dir
);
__hidden
extern
FILE
*
fdopen_cached
(
int
fd
,
const
char
*
mode
,
void
**
caller_freed_buffer
);
extern
FILE
*
fdopen_cached
(
int
fd
,
const
char
*
mode
,
void
**
caller_freed_buffer
);
__hidden
extern
FILE
*
fopen_cached
(
const
char
*
path
,
const
char
*
mode
,
void
**
caller_freed_buffer
);
extern
FILE
*
fopen_cached
(
const
char
*
path
,
const
char
*
mode
,
__hidden
extern
int
timens_offset_write
(
clockid_t
clk_id
,
int64_t
s_offset
,
int64_t
ns_offset
);
void
**
caller_freed_buffer
);
extern
int
timens_offset_write
(
clockid_t
clk_id
,
int64_t
s_offset
,
int64_t
ns_offset
);
#endif
/* __LXC_FILE_UTILS_H */
#endif
/* __LXC_FILE_UTILS_H */
src/tests/Makefile.am
View file @
4a9ee78a
...
@@ -2,9 +2,31 @@ if ENABLE_TESTS
...
@@ -2,9 +2,31 @@ if ENABLE_TESTS
LDADD
=
../lxc/liblxc.la
LDADD
=
../lxc/liblxc.la
lxc_test_api_reboot_SOURCES
=
api_reboot.c
lxc_test_api_reboot_SOURCES
=
api_reboot.c
\
../lxc/af_unix.c ../lxc/af_unix.h
\
../lxc/caps.c ../lxc/caps.h
\
../lxc/commands.c ../lxc/commands.h
\
../lxc/commands_utils.c ../lxc/commands_utils.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
lxc_test_apparmor_SOURCES
=
aa.c
lxc_test_apparmor_SOURCES
=
aa.c
lxc_test_attach_SOURCES
=
attach.c
lxc_test_attach_SOURCES
=
attach.c
\
../lxc/af_unix.c ../lxc/af_unix.h
\
../lxc/caps.c ../lxc/caps.h
\
../lxc/commands.c ../lxc/commands.h
\
../lxc/commands_utils.c ../lxc/commands_utils.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
lxc_test_basic_SOURCES
=
basic.c
lxc_test_basic_SOURCES
=
basic.c
lxc_test_cgpath_SOURCES
=
cgpath.c
\
lxc_test_cgpath_SOURCES
=
cgpath.c
\
../lxc/af_unix.c ../lxc/af_unix.h
\
../lxc/af_unix.c ../lxc/af_unix.h
\
...
@@ -14,6 +36,7 @@ lxc_test_cgpath_SOURCES = cgpath.c \
...
@@ -14,6 +36,7 @@ lxc_test_cgpath_SOURCES = cgpath.c \
../lxc/conf.c ../lxc/conf.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
../lxc/string_utils.c ../lxc/string_utils.h
...
@@ -28,6 +51,7 @@ lxc_test_config_jump_table_SOURCES = config_jump_table.c \
...
@@ -28,6 +51,7 @@ lxc_test_config_jump_table_SOURCES = config_jump_table.c \
../lxc/conf.c ../lxc/conf.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
../lxc/string_utils.c ../lxc/string_utils.h
...
@@ -45,7 +69,10 @@ lxc_test_list_SOURCES = list.c
...
@@ -45,7 +69,10 @@ lxc_test_list_SOURCES = list.c
lxc_test_locktests_SOURCES
=
locktests.c
lxc_test_locktests_SOURCES
=
locktests.c
lxc_test_lxcpath_SOURCES
=
lxcpath.c
lxc_test_lxcpath_SOURCES
=
lxcpath.c
lxc_test_may_control_SOURCES
=
may_control.c
lxc_test_may_control_SOURCES
=
may_control.c
lxc_test_mount_injection_SOURCES
=
mount_injection.c lxctest.h
lxc_test_mount_injection_SOURCES
=
mount_injection.c
\
lxctest.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/string_utils.c ../lxc/string_utils.h
lxc_test_parse_config_file_SOURCES
=
parse_config_file.c
\
lxc_test_parse_config_file_SOURCES
=
parse_config_file.c
\
lxctest.h
\
lxctest.h
\
../lxc/af_unix.c ../lxc/af_unix.h
\
../lxc/af_unix.c ../lxc/af_unix.h
\
...
@@ -53,6 +80,7 @@ lxc_test_parse_config_file_SOURCES = parse_config_file.c \
...
@@ -53,6 +80,7 @@ lxc_test_parse_config_file_SOURCES = parse_config_file.c \
../lxc/conf.c ../lxc/conf.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
../lxc/string_utils.c ../lxc/string_utils.h
...
@@ -67,7 +95,9 @@ lxc_test_saveconfig_SOURCES = saveconfig.c
...
@@ -67,7 +95,9 @@ lxc_test_saveconfig_SOURCES = saveconfig.c
lxc_test_share_ns_SOURCES
=
share_ns.c
\
lxc_test_share_ns_SOURCES
=
share_ns.c
\
lxctest.h
\
lxctest.h
\
../lxc/compiler.h
../lxc/compiler.h
lxc_test_shortlived_SOURCES
=
shortlived.c
lxc_test_shortlived_SOURCES
=
shortlived.c
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/string_utils.c ../lxc/string_utils.h
lxc_test_shutdowntest_SOURCES
=
shutdowntest.c
lxc_test_shutdowntest_SOURCES
=
shutdowntest.c
lxc_test_snapshot_SOURCES
=
snapshot.c
lxc_test_snapshot_SOURCES
=
snapshot.c
lxc_test_startone_SOURCES
=
startone.c
lxc_test_startone_SOURCES
=
startone.c
...
@@ -83,6 +113,7 @@ lxc_test_utils_SOURCES = lxc-test-utils.c \
...
@@ -83,6 +113,7 @@ lxc_test_utils_SOURCES = lxc-test-utils.c \
../lxc/conf.c ../lxc/conf.h
\
../lxc/conf.c ../lxc/conf.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile.c ../lxc/confile.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/confile_utils.c ../lxc/confile_utils.h
\
../lxc/file_utils.c ../lxc/file_utils.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/network.c ../lxc/network.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/nl.c ../lxc/nl.h
\
../lxc/string_utils.c ../lxc/string_utils.h
../lxc/string_utils.c ../lxc/string_utils.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