hare

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

commit 9e6a3ec48ba88ac375d0bd322b9379147a12cdea
parent 403b0aaf874ed79e102c51b9d2c479201c3765bd
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu,  5 May 2022 17:36:15 -0400

rt+linux: make cmsghdr arch-dependent

The structure differs on big-endian architectures.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mrt/+linux/+aarch64.ha | 7+++++++
Mrt/+linux/+riscv64.ha | 7+++++++
Mrt/+linux/+x86_64.ha | 7+++++++
Mrt/+linux/socket.ha | 8--------
4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/rt/+linux/+aarch64.ha b/rt/+linux/+aarch64.ha @@ -32,3 +32,10 @@ export fn clone( export def O_DIRECTORY: int = 0o40000; export def O_DIRECT: int = 0o200000; + +export type cmsghdr = struct { + cmsg_len: socklen_t, + _padding: int, + cmsg_level: int, + cmsg_type: int, +}; diff --git a/rt/+linux/+riscv64.ha b/rt/+linux/+riscv64.ha @@ -30,3 +30,10 @@ export fn clone( export def O_DIRECTORY: int = 0o200000; export def O_DIRECT: int = 0o40000; + +export type cmsghdr = struct { + cmsg_len: socklen_t, + _padding: int, + cmsg_level: int, + cmsg_type: int, +}; diff --git a/rt/+linux/+x86_64.ha b/rt/+linux/+x86_64.ha @@ -29,3 +29,10 @@ export fn clone( export def O_DIRECTORY: int = 0o200000; export def O_DIRECT: int = 0o40000; + +export type cmsghdr = struct { + cmsg_len: socklen_t, + _padding: int, + cmsg_level: int, + cmsg_type: int, +}; diff --git a/rt/+linux/socket.ha b/rt/+linux/socket.ha @@ -63,14 +63,6 @@ export type msghdr = struct { msg_flags: int }; -export type cmsghdr = struct { - // XXX: This structure differs on big-endian machines - cmsg_len: socklen_t, - _padding: int, - cmsg_level: int, - cmsg_type: int, -}; - export type cmsg = struct { hdr: cmsghdr, cmsg_data: [*]u8,