]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing: move statx related definitions to missing_stat.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Dec 2018 06:56:19 +0000 (07:56 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Dec 2018 07:27:50 +0000 (08:27 +0100)
src/basic/meson.build
src/basic/missing.h
src/basic/missing_stat.h [new file with mode: 0644]
src/basic/missing_syscall.h

index 5b8ccb495bb260de12a5f202960315407747d900..5d03c68a07c992e45048f38ff6b869f83208fd16 100644 (file)
@@ -104,6 +104,7 @@ basic_sources = files('''
         missing_magic.h
         missing_network.h
         missing_securebits.h
+        missing_stat.h
         missing_syscall.h
         missing_vxcan.h
         mkdir-label.c
index bfd9f23b9456a70bbcae73031748aacd0c5e7fb3..c35621cf2babcb1bfad924253b6a8e04c5174a56 100644 (file)
 #include <stdlib.h>
 #include <sys/resource.h>
 #include <sys/socket.h>
-#include <sys/stat.h>
 #include <sys/syscall.h>
 #include <uchar.h>
 #include <unistd.h>
 
-#if WANT_LINUX_STAT_H
-#include <linux/stat.h>
-#endif
-
 #if HAVE_AUDIT
 #include <libaudit.h>
 #endif
@@ -388,45 +383,6 @@ struct sockaddr_vm {
 #define PF_KTHREAD 0x00200000
 #endif
 
-#if ! HAVE_STRUCT_STATX
-struct statx_timestamp {
-        int64_t tv_sec;
-        uint32_t tv_nsec;
-        uint32_t __reserved;
-};
-struct statx {
-        uint32_t stx_mask;
-        uint32_t stx_blksize;
-        uint64_t stx_attributes;
-        uint32_t stx_nlink;
-        uint32_t stx_uid;
-        uint32_t stx_gid;
-        uint16_t stx_mode;
-        uint16_t __spare0[1];
-        uint64_t stx_ino;
-        uint64_t stx_size;
-        uint64_t stx_blocks;
-        uint64_t stx_attributes_mask;
-        struct statx_timestamp stx_atime;
-        struct statx_timestamp stx_btime;
-        struct statx_timestamp stx_ctime;
-        struct statx_timestamp stx_mtime;
-        uint32_t stx_rdev_major;
-        uint32_t stx_rdev_minor;
-        uint32_t stx_dev_major;
-        uint32_t stx_dev_minor;
-        uint64_t __spare2[14];
-};
-#endif
-
-#ifndef STATX_BTIME
-#define STATX_BTIME 0x00000800U
-#endif
-
-#ifndef AT_STATX_DONT_SYNC
-#define AT_STATX_DONT_SYNC 0x4000
-#endif
-
 /* The maximum thread/process name length including trailing NUL byte. This mimics the kernel definition of the same
  * name, which we need in userspace at various places but is not defined in userspace currently, neither under this
  * name nor any other. */
@@ -438,4 +394,5 @@ struct statx {
 #include "missing_input.h"
 #include "missing_magic.h"
 #include "missing_network.h"
+
 #include "missing_syscall.h"
diff --git a/src/basic/missing_stat.h b/src/basic/missing_stat.h
new file mode 100644 (file)
index 0000000..85f98e2
--- /dev/null
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
+
+#include <linux/types.h>
+#include <sys/stat.h>
+
+#if WANT_LINUX_STAT_H
+#include <linux/stat.h>
+#endif
+
+/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
+#if !HAVE_STRUCT_STATX
+struct statx_timestamp {
+        int64_t tv_sec;
+        uint32_t tv_nsec;
+        uint32_t __reserved;
+};
+struct statx {
+        uint32_t stx_mask;
+        uint32_t stx_blksize;
+        uint64_t stx_attributes;
+        uint32_t stx_nlink;
+        uint32_t stx_uid;
+        uint32_t stx_gid;
+        uint16_t stx_mode;
+        uint16_t __spare0[1];
+        uint64_t stx_ino;
+        uint64_t stx_size;
+        uint64_t stx_blocks;
+        uint64_t stx_attributes_mask;
+        struct statx_timestamp stx_atime;
+        struct statx_timestamp stx_btime;
+        struct statx_timestamp stx_ctime;
+        struct statx_timestamp stx_mtime;
+        uint32_t stx_rdev_major;
+        uint32_t stx_rdev_minor;
+        uint32_t stx_dev_major;
+        uint32_t stx_dev_minor;
+        uint64_t __spare2[14];
+};
+#endif
+
+/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
+#ifndef STATX_BTIME
+#define STATX_BTIME 0x00000800U
+#endif
+
+/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
+#ifndef AT_STATX_DONT_SYNC
+#define AT_STATX_DONT_SYNC 0x4000
+#endif
index f118e0ff3890f62b1557528563bf28f1248c952b..5060a3f6ad4ebdeb93bf3b0937fe0d02ee8111ac 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/types.h>
 
 #include "missing_keyctl.h"
+#include "missing_stat.h"
 
 #if !HAVE_PIVOT_ROOT
 static inline int missing_pivot_root(const char *new_root, const char *put_old) {