Skip to content

Commit 2a86389

Browse files
committed
Only Add "__attribute__((__packed__))" For "epoll_event" If Building For x86
1 parent 91d7d50 commit 2a86389

File tree

1 file changed

+7
-1
lines changed
  • darling/src/libsystem_kernel/emulation/linux/ext/sys

1 file changed

+7
-1
lines changed

darling/src/libsystem_kernel/emulation/linux/ext/sys/epoll.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ enum EPOLL_EVENTS
2828
#define EPOLL_CTL_DEL 2
2929
#define EPOLL_CTL_MOD 3
3030

31+
#if defined(__x86_64__) || defined(__i386__)
32+
#define __EPOLL_PACKED __attribute__ ((__packed__))
33+
#else
34+
#error "Missing __EPOLL_PACKED definition for arch"
35+
#endif
36+
3137
typedef union epoll_data
3238
{
3339
void *ptr;
@@ -40,7 +46,7 @@ struct epoll_event
4046
{
4147
uint32_t events;
4248
epoll_data_t data;
43-
} __attribute__((packed));
49+
} __EPOLL_PACKED;
4450

4551
extern int epoll_create (int __size) __THROW;
4652

0 commit comments

Comments
 (0)