#include <sys/sysinfo.h>
#include <sys/vfs.h>
+#include "api_extensions.h"
#include "bindings.h"
#include "config.h"
#include "cgroup_fuse.h"
static int send_creds_clone_wrapper(void *arg)
{
- struct ucred cred;
- char v;
- int sock = *(int *)arg;
-
- /* we are the child */
- cred.uid = 0;
- cred.gid = 0;
- cred.pid = 1;
- v = '1';
- if (send_creds(sock, &cred, v, true) != SEND_CREDS_OK)
- return 1;
- return 0;
+ int sock = PTR_TO_INT(arg);
+ char v = '1'; /* we are the child */
+ struct ucred cred = {
+ .uid = 0,
+ .gid = 0,
+ .pid = 1,
+ };
+
+ return send_creds(sock, &cred, v, true) != SEND_CREDS_OK;
}
/*
if (setns(fd, 0))
log_exit("Failed to setns to pid namespace of process %d", target);
- pid = lxcfs_clone(send_creds_clone_wrapper, &sock, 0);
+ pid = lxcfs_clone(send_creds_clone_wrapper, INT_TO_PTR(sock), 0);
if (pid < 0)
_exit(EXIT_FAILURE);
pidfd = pidfd_open(pid, 0);
if (pidfd >= 0 && pidfd_send_signal(pidfd, 0, NULL, 0) == 0) {
can_use_pidfd = true;
- lxcfs_error("Kernel supports pidfds");
+ fprintf(stderr, "Kernel supports pidfds\n");
}
+
+ fprintf(stderr, "api_extensions:\n");
+ for (i = 0; i < nr_api_extensions; i++)
+ fprintf(stderr, "- %s\n", api_extensions[i]);
}
static void __attribute__((destructor)) lxcfs_exit(void)