hare

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

commit c256d7067888ccea3a747dee26ae5e9c9beb709c
parent d51603685572153b6a17f5d4417474eb2a13be17
Author: Armin Preiml <apreiml@strohwolke.at>
Date:   Tue, 15 Nov 2022 14:49:52 +0100

rt: make alarm syscall only available to x86_64

It's not available in aarch64.

Signed-off-by: Armin Preiml <apreiml@strohwolke.at>

Diffstat:
Mrt/+linux/syscalls.ha | 4----
Art/+linux/syscallsarch+aarch64.ha | 3+++
Art/+linux/syscallsarch+riscv64.ha | 3+++
Art/+linux/syscallsarch+x86_64.ha | 7+++++++
Mscripts/gen-stdlib | 1+
Mstdlib.mk | 2++
6 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -864,10 +864,6 @@ export fn tee(fd_in: int, fd_out: int, ln: size, flags: uint) (size | errno) = { ln: u64, flags: u64))?: size; }; -export fn alarm(seconds: uint) uint = { - return syscall1(SYS_alarm, seconds: u64): uint; -}; - export fn fallocate(fd: int, mode: int, off: i64, ln: i64) (void | errno) = { wrap_return(syscall4(SYS_fallocate, fd: u64, mode: u64, off: u64, ln: u64))?; diff --git a/rt/+linux/syscallsarch+aarch64.ha b/rt/+linux/syscallsarch+aarch64.ha @@ -0,0 +1,3 @@ +// License: MPL-2.0 + +// Dummy to make the build work. diff --git a/rt/+linux/syscallsarch+riscv64.ha b/rt/+linux/syscallsarch+riscv64.ha @@ -0,0 +1,3 @@ +// License: MPL-2.0 + +// Dummy to make the build work. diff --git a/rt/+linux/syscallsarch+x86_64.ha b/rt/+linux/syscallsarch+x86_64.ha @@ -0,0 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Sebastian <sebastian@sebsite.pw> + +export fn alarm(seconds: uint) uint = { + return syscall1(SYS_alarm, seconds: u64): uint; +}; + diff --git a/scripts/gen-stdlib b/scripts/gen-stdlib @@ -29,6 +29,7 @@ gensrcs_rt() { +linux/'+$(ARCH)'.ha \ +linux/syscallno+'$(ARCH)'.ha \ +linux/syscalls.ha \ + +linux/syscallsarch+'$(ARCH)'.ha \ +linux/signal.ha \ +linux/stat.ha \ +linux/socket.ha \ diff --git a/stdlib.mk b/stdlib.mk @@ -13,6 +13,7 @@ stdlib_rt_linux_srcs = \ $(STDLIB)/rt/+linux/+$(ARCH).ha \ $(STDLIB)/rt/+linux/syscallno+$(ARCH).ha \ $(STDLIB)/rt/+linux/syscalls.ha \ + $(STDLIB)/rt/+linux/syscallsarch+$(ARCH).ha \ $(STDLIB)/rt/+linux/signal.ha \ $(STDLIB)/rt/+linux/stat.ha \ $(STDLIB)/rt/+linux/socket.ha \ @@ -2183,6 +2184,7 @@ testlib_rt_linux_srcs = \ $(STDLIB)/rt/+linux/+$(ARCH).ha \ $(STDLIB)/rt/+linux/syscallno+$(ARCH).ha \ $(STDLIB)/rt/+linux/syscalls.ha \ + $(STDLIB)/rt/+linux/syscallsarch+$(ARCH).ha \ $(STDLIB)/rt/+linux/signal.ha \ $(STDLIB)/rt/+linux/stat.ha \ $(STDLIB)/rt/+linux/socket.ha \