script:
- ./bootstrap.sh
- - ./configure --prefix=/usr
+ - CFLAGS='-g -O0 -std=c11 -DDEBUG -DVERBOSE -DRESOLVE_NOW -Wall -Werror' ./configure --prefix=/usr
- make -j4
- (cd tests && make tests)
- echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
return sigaction(signo, &action, NULL);
}
-extern pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags);
+extern pid_t lxcfs_raw_clone(unsigned long flags, int *pidfd);
+
+static inline pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
+{
+ pid_t pid;
+
+ pid = lxcfs_raw_clone(flags, NULL);
+ if (pid < 0)
+ return -1;
+
+ if (pid == 0)
+ _exit(fn(arg));
+
+ return pid;
+}
#endif /* __LXCFS_BINDINGS_H */
}
/* First try loading using ld.so */
+#ifdef RESOLVE_NOW
+ dlopen_handle = dlopen("liblxcfs.so", RTLD_NOW);
+#else
dlopen_handle = dlopen("liblxcfs.so", RTLD_LAZY);
+#endif
if (dlopen_handle) {
lxcfs_debug("Opened liblxcfs.so");
goto good;
static int proc_swaps_read(char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
- __do_free char *cgroup = NULL, *memswlimit_str = NULL, *memusage_str = NULL,
- *memswusage_str = NULL;
+ __do_free char *cgroup = NULL, *memusage_str = NULL, *memswusage_str = NULL;
struct fuse_context *fc = fuse_get_context();
struct lxcfs_opts *opts = (struct lxcfs_opts *)fuse_get_context()->private_data;
bool wants_swap = opts && !opts->swap_off && liblxcfs_can_use_swap();