Skip to content

Move syscall definitions to an external package. - #282

Merged
skx merged 2 commits into
mainfrom
281-syscalls
Oct 4, 2026
Merged

skx merged 2 commits into
mainfrom
281-syscalls

Conversation

@skx

@skx skx commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Rather than just defining the few syscalls we use, inline, in stdlib.lisp we now auto-generate all known system call numbers.

For example:

 $ head -n 20 packages/syscall.lisp 
;;; syscall-constants
;;
;; These constants define known syscalls, and are auto-generated.
;;
(defconst SYS_read 0)
(defconst SYS_write 1)
(defconst SYS_open 2)
(defconst SYS_close 3)
(defconst SYS_stat 4)
(defconst SYS_fstat 5)
(defconst SYS_lstat 6)
(defconst SYS_poll 7)
(defconst SYS_lseek 8)
(defconst SYS_mmap 9)
(defconst SYS_mprotect 10)
(defconst SYS_munmap 11)
(defconst SYS_brk 12)
(defconst SYS_rt_sigaction 13)
(defconst SYS_rt_sigprocmask 14)
(defconst SYS_rt_sigreturn 15)

This means they're available for use, directly, by users and don't need to be defined specially.

This closes #281.

@skx
skx merged commit 982951d into main Oct 4, 2026
1 check passed
@skx
skx deleted the 281-syscalls branch October 4, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a new package for storing syscall numbers

1 participant