aboutsummaryrefslogtreecommitdiff
path: root/include/util
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-25 00:08:02 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-25 00:08:02 +0200
commit8b80fb92e5e07637f42382ec4e6e3417ade185c9 (patch)
treebe4a49ea5d33219abd9ce4445d1cdf741443d1b4 /include/util
parent67b22f3fe40cd1da8a20559448b2ea4a52142808 (diff)
Add mockup of "struct stat" for WinDOS
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/util')
-rw-r--r--include/util/compat.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/util/compat.h b/include/util/compat.h
index 74d0b6f..d69a1de 100644
--- a/include/util/compat.h
+++ b/include/util/compat.h
@@ -38,6 +38,8 @@
#endif
#if defined(_WIN32) || defined(__WINDOWS__)
+#include "sqfs/inode.h"
+
#define S_IFSOCK SQFS_INODE_MODE_SOCK
#define S_IFLNK SQFS_INODE_MODE_LNK
#define S_IFREG SQFS_INODE_MODE_REG
@@ -74,6 +76,22 @@
#define S_IWOTH SQFS_INODE_OTHERS_W
#define S_IXOTH SQFS_INODE_OTHERS_X
+struct stat {
+ sqfs_u32 st_dev;
+ sqfs_u32 st_ino;
+ sqfs_u16 st_mode;
+ sqfs_u16 st_nlink;
+ sqfs_u32 st_uid;
+ sqfs_u32 st_gid;
+ sqfs_u32 st_rdev;
+ sqfs_u64 st_size;
+ sqfs_u32 st_blksize;
+ sqfs_u32 st_blocks;
+ sqfs_u64 st_atime;
+ sqfs_u64 st_mtime;
+ sqfs_u64 st_ctime;
+};
+
/* lifted from musl libc */
#define major(x) \
((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) ))