Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
rustix can make syscalls directly to Linux. There's a rustc fork that can use it to build std.
Windows: Syscalls are undocumented and unstable, and it is in fact impossible to compile any native code for Windows without linking against proprietary lib files ("import library" in Windows lingo). That said, there is a new feature #[link(kind="raw-dylib")] that allows windows-rs crate to link against dlls directly instead of using compile time import libraries: https://github.com/microsoft/windows-rs/pull/977. This is as "native" as you can get on Windows.
libc isn't "just a wrapper". Is a massive legacy codebase filled with hacks, UBs and bugs: https://github.com/chronotope/chrono/issues/499
And then there are some interfaces in libc that just look absolutely nothing like the system APIs. In libc, if you want to list the contents of a directory you call opendir then repeatedly call readdir to get a pointer to the next entry in the directory. But behind readdir is an array of directory entry types. So if you're implementing something like ls on top of libc, in most cases you end up dominated by small inefficiencies like that. I wrote this basically to see how big that effect is, the answer is somewhere around 2x: https://github.com/saethlin/fls
This was one of them https://github.com/golang/go/issues/6719