by newpavlov · 2y ago · 0 comments
It only became something else, when C got standardised, a tiny subset of it landed into ISO C, grew beyond UNIX, and the rest of the UNIX API surface landed at Open Group's POSIX.
Obviously on the UNIX world nothing changed, until GNU/Linux came into scene and decided to act in another way, due to being GNU ecosystem + Linux kernel combo.
Linux has successfully paved the way and demonstrated its practicality. Yes, it made certain unfortunate mistakes along the way, but OpenBSD (or any other OS) can learn from those and provide a better solution.
If you mean a C based OS ABI, there are many other alternatives, like on managed OSes, IBM and Unisys surviving mainframe and micro computers, OS IPC like COM/XPC/AIDL/FIDL/D-BUS.
That is one _heck_ of a TL;DR executive summary! I am quietly awed. I doff my hat to you for this.
Nobody seems to understand how this feature works, even though it's quite simple. The process asks the kernel to only allow system calls from one segment. If you don't like that, don't ask for it.
Calling into system calls in libc is not a hindrance at all for the use of other languages, any more than calling directly into a syscall would be. Cross-language function calls have been a time honored tradition since the first compilers were developed.
Linux's ossified syscall ABI is a quirk of Linux, and not a feature found in most, let alone many, operating systems.
I would say that it is a hindrance though. It's a hindrance even for relatively straight forward C code. You cannot for example use clone and expect the libc to continue working.
https://sourceware.org/bugzilla/show_bug.cgi?id=10311
> If you use clone() you're on your own.
These libraries are the problem, not the solution. They're full of static global data which will get clobbered whenever you do anything more complicated than I/O. They use thread local variables for returning errors codes. It's bad legacy stuff.
And FFS, Ive been using OpenBSD for well over 2 decades now. I'd say any syscall changes done in the OS are minimal compared to eg. linux.