hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 3688d16c750f789d08488a592e55b6e9bb5db78d
parent 66e5280e484eaa7b2ab316bf1586b9b61412901f
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  2 Jan 2023 19:28:11 +0100

rt: epoll_event is @packed on x86_64

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mrt/+linux/+x86_64.ha | 6++++++
Art/+linux/-x86_64.ha | 5+++++
Mrt/+linux/types.ha | 5-----
3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/rt/+linux/+x86_64.ha b/rt/+linux/+x86_64.ha @@ -41,3 +41,9 @@ export type cmsghdr = struct { }; export def EDEADLOCK: int = EDEADLK; + +export type epoll_event = struct @packed { + // Packed on x86_64 + events: u32, + data: epoll_data, +}; diff --git a/rt/+linux/-x86_64.ha b/rt/+linux/-x86_64.ha @@ -0,0 +1,5 @@ +export type epoll_event = struct { + // Not packed on !x86_64 + events: u32, + data: epoll_data, +}; diff --git a/rt/+linux/types.ha b/rt/+linux/types.ha @@ -393,11 +393,6 @@ export type epoll_data = union { u64_: u64, }; -export type epoll_event = struct { - events: u32, - @offset(4) data: epoll_data, -}; - export def EFD_CLOEXEC: int = O_CLOEXEC; export def EFD_NONBLOCK: int = O_NONBLOCK; export def EFD_SEMAPHORE: int = 1;