qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 05/16] hw/9pfs: Update P9_FILE_ID to support Windows


From: Bin Meng
Subject: [PATCH 05/16] hw/9pfs: Update P9_FILE_ID to support Windows
Date: Mon, 24 Oct 2022 12:57:48 +0800

On Windows P9_FILE_ID points to a file handle.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 hw/9pfs/9p-file-id.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/9pfs/9p-file-id.h b/hw/9pfs/9p-file-id.h
index 60cbfbf4dd..00903048e6 100644
--- a/hw/9pfs/9p-file-id.h
+++ b/hw/9pfs/9p-file-id.h
@@ -11,11 +11,19 @@
 /*
  * 9pfs file id
  *
- * This is file descriptor on POSIX platforms
+ * This is file descriptor on POSIX platforms, handle on Windows
  */
+#ifndef CONFIG_WIN32
 typedef int P9_FILE_ID;
+#else
+typedef HANDLE P9_FILE_ID;
+#endif
 
 /* invalid value for P9_FILE_ID */
+#ifndef CONFIG_WIN32
 #define P9_INVALID_FILE -1
+#else
+#define P9_INVALID_FILE INVALID_HANDLE_VALUE
+#endif
 
 #endif
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]