bionic: make epoll_event structure packed
Description: In the kernel the epoll_event structure is packed
in 64 bit kernel builds to allow the structure to be more easily
compatible with 32 bit user space. As a result, when user space
is 64-bit the structure must be packed as well.
Add unit test to show the ptr alignment issue.
Change-Id: I2c4848d5e38a357219091f350f9b6e3da05090da
Signed-off-by: Philip Hatcher <philip.hatcher@intel.com>
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Reviewed-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
Tested-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index c06a081..4a5a37c 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -67,7 +67,11 @@
struct epoll_event {
uint32_t events;
epoll_data_t data;
-};
+}
+#ifdef __x86_64__
+__packed
+#endif
+;
int epoll_create(int);
int epoll_create1(int);