Skip to content

Commit

Permalink
Only Add "__attribute__((__packed__))" For "epoll_event" If Building …
Browse files Browse the repository at this point in the history
…For x86
  • Loading branch information
CuriousTommy committed Jun 21, 2024
1 parent 91d7d50 commit 2a86389
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion darling/src/libsystem_kernel/emulation/linux/ext/sys/epoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ enum EPOLL_EVENTS
#define EPOLL_CTL_DEL 2
#define EPOLL_CTL_MOD 3

#if defined(__x86_64__) || defined(__i386__)
#define __EPOLL_PACKED __attribute__ ((__packed__))
#else
#error "Missing __EPOLL_PACKED definition for arch"
#endif

typedef union epoll_data
{
void *ptr;
Expand All @@ -40,7 +46,7 @@ struct epoll_event
{
uint32_t events;
epoll_data_t data;
} __attribute__((packed));
} __EPOLL_PACKED;

extern int epoll_create (int __size) __THROW;

Expand Down

0 comments on commit 2a86389

Please sign in to comment.