zlacker

[parent] [thread] 2 comments
1. oguz-i+(OP)[view] [source] 2026-02-03 03:53:31
> How does that work, with syscalls being unable to be called except from the system’s libc?

OpenBSD allows system calls being made from shared libraries whose names start with `libc.so.' and all static binaries, as long as they include an `openbsd.syscalls' section listing call sites.

replies(1): >>Goblin+Pq2
2. Goblin+Pq2[view] [source] 2026-02-03 19:03:52
>>oguz-i+(OP)
Can't you just have one syscall(2) to rule them all? https://man7.org/linux/man-pages/man2/syscall.2.html
replies(1): >>oguz-i+dP3
◧◩
3. oguz-i+dP3[view] [source] [discussion] 2026-02-04 03:09:03
>>Goblin+Pq2
You can. There is a thread-unsafe implementation here <https://gist.github.com/oguz-ismail/72e34550af13e3841ed58e29...>. But the listing needs to be per system call number, so this one only supports system calls 1 (_exit) and 4 (write). It should be fairly easy to automatically generate the complete list but I didn't try it.
[go to top]