zlacker

[parent] [thread] 1 comments
1. marcos+(OP)[view] [source] 2023-10-27 19:12:57
I'm pretty sure if you just repackage the syscalls into a basic module of your language, you will get more stability than by linking to the libc.

I guess people don't do it because the difference is minimal and they use a lot of other features from the C runtime too.

EDIT: Ops. Not on BSD! The entire thread is about BSD and here I am mindlessly talking about Linux.

replies(1): >>dpasse+n1
2. dpasse+n1[view] [source] 2023-10-27 19:21:53
>>marcos+(OP)
Only on systems where the syscall ABI is stable, like on Linux. Others, like macOS and Windows[0], can and will change theirs between releases. OpenBSD even goes one step further and actively prevents code other than libc from performing syscalls[1]

[0] I seem to remember that this changed in a recent Windows version, but I couldn't immediately find a source.

[1] msyscall(2) or, if you don't have an OpenBSD system at hand, https://man.openbsd.org/msyscall

[go to top]