chiark / gitweb /
Prep v228: Clean up the new src/basic/*-util-[hc] files:
[elogind.git] / src / basic / memfd-util.c
index b6dc19082864c647189c5181fa52df99bbedbe81..e6eb1d45fc5d2f46a5c16582213d2c41178c63fa 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-
 #ifdef HAVE_LINUX_MEMFD_H
 #  include <linux/memfd.h>
 #endif
+#include <stdio.h>
+#include <sys/mman.h>
+#include <sys/prctl.h>
 
-#include "util.h"
+#include "alloc-util.h"
+#include "fd-util.h"
 #include "memfd-util.h"
-#include "utf8.h"
 #include "missing.h"
+#include "string-util.h"
+#include "utf8.h"
+#include "util.h"
 
 int memfd_new(const char *name) {
         _cleanup_free_ char *g = NULL;
@@ -70,6 +72,8 @@ int memfd_new(const char *name) {
         return fd;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int memfd_map(int fd, uint64_t offset, size_t size, void **p) {
         void *q;
         int sealed;
@@ -93,6 +97,7 @@ int memfd_map(int fd, uint64_t offset, size_t size, void **p) {
         *p = q;
         return 0;
 }
+#endif // 0
 
 int memfd_set_sealed(int fd) {
         int r;
@@ -106,6 +111,8 @@ int memfd_set_sealed(int fd) {
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 int memfd_get_sealed(int fd) {
         int r;
 
@@ -118,6 +125,8 @@ int memfd_get_sealed(int fd) {
         return r == (F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int memfd_get_size(int fd, uint64_t *sz) {
         struct stat stat;
         int r;
@@ -132,6 +141,7 @@ int memfd_get_size(int fd, uint64_t *sz) {
         *sz = stat.st_size;
         return 0;
 }
+#endif // 0
 
 int memfd_set_size(int fd, uint64_t sz) {
         int r;