From: Bin Meng <bmeng.cn@gmail.com>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>,
Greg Kurz <groug@kaod.org>,
qemu-devel@nongnu.org
Cc: Bin Meng <bin.meng@windriver.com>,
Guohuai Shi <guohuai.shi@windriver.com>
Subject: [PATCH 4/9] fsdev: Add missing definitions for Windows in file-op-9p.h
Date: Mon, 25 Apr 2022 22:27:00 +0800 [thread overview]
Message-ID: <20220425142705.2099270-5-bmeng.cn@gmail.com> (raw)
In-Reply-To: <20220425142705.2099270-1-bmeng.cn@gmail.com>
From: Guohuai Shi <guohuai.shi@windriver.com>
Add uid_t, gid_t and struct statfs definitions, which are currently
missing from Windows headers, but are required when we add 9p file
system support for Windows in later patches.
Signed-off-by: Guohuai Shi <guohuai.shi@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
fsdev/file-op-9p.h | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
index 4997677460..7d9a736b66 100644
--- a/fsdev/file-op-9p.h
+++ b/fsdev/file-op-9p.h
@@ -27,6 +27,39 @@
# include <sys/mount.h>
#endif
+#ifdef CONFIG_WIN32
+
+/* POSIX structure not defined in Windows */
+
+typedef uint32_t uid_t;
+typedef uint32_t gid_t;
+
+/* from http://man7.org/linux/man-pages/man2/statfs.2.html */
+typedef uint32_t __fsword_t;
+typedef uint32_t fsblkcnt_t;
+typedef uint32_t fsfilcnt_t;
+
+/* from linux/include/uapi/asm-generic/posix_types.h */
+typedef struct {
+ long __val[2];
+} fsid_t;
+
+struct statfs {
+ __fsword_t f_type;
+ __fsword_t f_bsize;
+ fsblkcnt_t f_blocks;
+ fsblkcnt_t f_bfree;
+ fsblkcnt_t f_bavail;
+ fsfilcnt_t f_files;
+ fsfilcnt_t f_ffree;
+ fsid_t f_fsid;
+ __fsword_t f_namelen;
+ __fsword_t f_frsize;
+ __fsword_t f_flags;
+};
+
+#endif /* CONFIG_WIN32 */
+
#define SM_LOCAL_MODE_BITS 0600
#define SM_LOCAL_DIR_MODE_BITS 0700
--
2.25.1
next prev parent reply other threads:[~2022-04-25 14:42 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 14:26 [PATCH 0/9] 9pfs: Add 9pfs support for Windows host Bin Meng
2022-04-25 14:26 ` [PATCH 1/9] hw/9pfs: Compile 9p-local.c and 9p-proxy.c for Linux and macOS Bin Meng
2022-04-25 14:26 ` [PATCH 2/9] qemu/xatth.h: Update for Windows build Bin Meng
2022-04-25 14:26 ` [PATCH 3/9] hw/9pfs: Extract common stuff to 9p-local.h Bin Meng
2022-04-25 14:27 ` Bin Meng [this message]
2022-05-04 17:35 ` [PATCH 4/9] fsdev: Add missing definitions for Windows in file-op-9p.h Christian Schoenebeck
2022-04-25 14:27 ` [PATCH 5/9] hw/9pfs: Add a 'local' file system backend driver for Windows Bin Meng
2022-05-04 18:01 ` Christian Schoenebeck
2022-05-04 19:34 ` Shi, Guohuai
2022-05-05 11:43 ` Christian Schoenebeck
2022-05-06 6:46 ` Shi, Guohuai
2022-05-09 14:29 ` Greg Kurz
2022-05-09 15:09 ` Shi, Guohuai
2022-05-09 16:20 ` Greg Kurz
2022-05-10 2:13 ` Shi, Guohuai
2022-05-10 2:17 ` Shi, Guohuai
2022-05-10 10:18 ` Christian Schoenebeck
2022-05-10 11:54 ` Christian Schoenebeck
2022-05-10 13:40 ` Greg Kurz
2022-05-10 14:04 ` Christian Schoenebeck
2022-05-10 14:34 ` Greg Kurz
2022-05-10 15:35 ` Shi, Guohuai
2022-05-11 11:18 ` Christian Schoenebeck
2022-05-11 12:18 ` Greg Kurz
2022-05-11 15:57 ` Shi, Guohuai
2022-05-24 12:23 ` Christian Schoenebeck
2022-04-25 14:27 ` [PATCH 6/9] hw/9pfs: Update 9p-synth.c for Windows build Bin Meng
2022-04-25 14:27 ` [PATCH 7/9] fsdev: Enable 'local' file system driver backend for Windows Bin Meng
2022-04-25 14:27 ` [PATCH 8/9] meson.build: Turn on virtfs for Windows host Bin Meng
2022-04-25 14:27 ` [PATCH 9/9] hw/9p: win32: Translate Windows error number to Linux value Bin Meng
2022-05-04 18:15 ` Christian Schoenebeck
2022-04-26 1:41 ` [PATCH 0/9] 9pfs: Add 9pfs support for Windows host Bin Meng
2022-05-03 3:42 ` Bin Meng
2022-05-04 17:16 ` Christian Schoenebeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220425142705.2099270-5-bmeng.cn@gmail.com \
--to=bmeng.cn@gmail.com \
--cc=bin.meng@windriver.com \
--cc=groug@kaod.org \
--cc=guohuai.shi@windriver.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).