]> git.proxmox.com Git - mirror_lxcfs.git/blobdiff - utils.h
tree-wide: post-restructuring cleanup
[mirror_lxcfs.git] / utils.h
diff --git a/utils.h b/utils.h
index 0a4dd3cd1a4bc52fa55cd7c6ca901cdb8aecc822..6c874b457863c51627881ba474765712effd83c6 100644 (file)
--- a/utils.h
+++ b/utils.h
@@ -3,16 +3,47 @@
 #ifndef __LXCFS_UTILS_H
 #define __LXCFS_UTILS_H
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#ifndef FUSE_USE_VERSION
 #define FUSE_USE_VERSION 26
+#endif
+
+#define _FILE_OFFSET_BITS 64
 
 #include <fuse.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#include "config.h"
+#include "macro.h"
 
 /* Reserve buffer size to account for file size changes. */
 #define BUF_RESERVE_SIZE 512
 
+#define SEND_CREDS_OK 0
+#define SEND_CREDS_NOTSK 1
+#define SEND_CREDS_FAIL 2
+
+struct file_info;
+
 extern void must_strcat(char **src, size_t *sz, size_t *asz, const char *format, ...);
 extern bool is_shared_pidns(pid_t pid);
 extern int preserve_ns(const int pid, const char *ns);
 extern void do_release_file_info(struct fuse_file_info *fi);
+extern bool recv_creds(int sock, struct ucred *cred, char *v);
+extern int send_creds(int sock, struct ucred *cred, char v, bool pingfirst);
+extern bool wait_for_sock(int sock, int timeout);
+extern int read_file_fuse(const char *path, char *buf, size_t size,
+                         struct file_info *d);
+extern void prune_init_slice(char *cg);
+extern int wait_for_pid(pid_t pid);
 
 #endif /* __LXCFS_UTILS_H */