[Drbd-dev] [PATCH] Make windrbd_ioctl.h usable without compat headers.
Johannes Thoma
johannes at johannesthoma.com
Mon Feb 4 21:59:52 CET 2019
This includes:
*) Not to use Linux kernel specific types (u32). Standard
C types (uint32_t) are used instead.
*) Define length of netlink message unless defined.
Since this file is WinDRBD-only it should not break Linux builds.
Signed-off-by: Johannes Thoma <johannes at johannesthoma.com>
---
windrbd/windrbd_ioctl.h | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/windrbd/windrbd_ioctl.h b/windrbd/windrbd_ioctl.h
index 0973a6be..22eb8af9 100644
--- a/windrbd/windrbd_ioctl.h
+++ b/windrbd/windrbd_ioctl.h
@@ -2,8 +2,16 @@
#define WINDRBD_IOCTL_H
#include <sys/types.h> /* for int64_t */
-#include <linux/types.h>
+
+#ifdef __CYGWIN__
+
+#ifndef GENL_NAMSIZ
+#define GENL_NAMSIZ 16
+#endif
+
+#else
#include <linux/netlink.h>
+#endif
/* For compiling this for drbd-utils when there are no Windows headers
* installed, we need this (taken from ReactOS): Hopefully this never
@@ -55,11 +63,11 @@ struct windrbd_ioctl_fault_injection {
#define IOCTL_WINDRBD_INJECT_FAULTS CTL_CODE(WINDRBD_DEVICE_TYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct windrbd_ioctl_genl_portid {
- u32 portid;
+ uint32_t portid;
};
struct windrbd_ioctl_genl_portid_and_multicast_group {
- u32 portid;
+ uint32_t portid;
char name[GENL_NAMSIZ];
};
--
2.17.0
More information about the drbd-dev
mailing list