authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-06 21:39:02+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-06 21:39:02+02:00
log60242e96dfd509eeb7a5746128410f471eb06dac
tree0437d266c15ddbea7dd93683e624f3e20eb9e5af
parent7a41af2632e693cd63476576bbbb965126e45b9b

Fix definition of epoll_* struct on non x86_64 arches


1 files changed, 7 insertions(+), 5 deletions(-)

std/os/linux.zig+7-5
......@@ -1390,17 +1390,19 @@ pub fn sched_getaffinity(pid: i32, set: []usize) usize {
13901390 return syscall3(SYS_sched_getaffinity, @bitCast(usize, isize(pid)), set.len * @sizeOf(usize), @ptrToInt(set.ptr));
13911391}
13921392
1393pub const epoll_data = packed union {
1393pub const epoll_data = extern union {
13941394 ptr: usize,
13951395 fd: i32,
13961396 @"u32": u32,
13971397 @"u64": u64,
13981398};
13991399
1400pub const epoll_event = packed struct {
1401 events: u32,
1402 data: epoll_data,
1403};
1400// On x86_64 the structure is packed so that it matches the definition of its
1401// 32bit counterpart
1402pub const epoll_event = if (builtin.arch != .x86_64)
1403 extern struct { events: u32, data: epoll_data }
1404 else
1405 packed struct { events: u32, data: epoll_data };
14041406
14051407pub fn epoll_create() usize {
14061408 return epoll_create1(0);