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 {...@@ -1390,17 +1390,19 @@ pub fn sched_getaffinity(pid: i32, set: []usize) usize {
1390 return syscall3(SYS_sched_getaffinity, @bitCast(usize, isize(pid)), set.len * @sizeOf(usize), @ptrToInt(set.ptr));1390 return syscall3(SYS_sched_getaffinity, @bitCast(usize, isize(pid)), set.len * @sizeOf(usize), @ptrToInt(set.ptr));
1391}1391}
13921392
1393pub const epoll_data = packed union {1393pub const epoll_data = extern union {
1394 ptr: usize,1394 ptr: usize,
1395 fd: i32,1395 fd: i32,
1396 @"u32": u32,1396 @"u32": u32,
1397 @"u64": u64,1397 @"u64": u64,
1398};1398};
13991399
1400pub const epoll_event = packed struct {1400// On x86_64 the structure is packed so that it matches the definition of its
1401 events: u32,1401// 32bit counterpart
1402 data: epoll_data,1402pub const epoll_event = if (builtin.arch != .x86_64)
1403};1403 extern struct { events: u32, data: epoll_data }
1404 else
1405 packed struct { events: u32, data: epoll_data };
14041406
1405pub fn epoll_create() usize {1407pub fn epoll_create() usize {
1406 return epoll_create1(0);1408 return epoll_create1(0);