diff mbox series

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

Message ID 20221024045759.448014-6-bin.meng@windriver.com
State New
Headers show
Series hw/9pfs: Add 9pfs support for Windows | expand

Commit Message

Bin Meng Oct. 24, 2022, 4:57 a.m. UTC
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 mbox series

Patch

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