core::arch is indeed very similar. So is
The description of
core says "It links to no upstream libraries, no system libraries, and no libc.".
Raw Linux syscalls don't require linking to a library, and if you're building for a Linux target, having a
core::os module doesn't seem drastically different than
core::os would only invoke some assembly. If appropriately inlined, ideally syscalls will compile down to "make sure the arguments end up in the appropriate registers, then invoke a
To the best of my knowledge, while people expect
core to compile and run without a memory allocator, and to be possible to compile and run without an OS, that doesn't mean a compiled build of
core is expected to be OS-independent. As far as I know, there's no degree to which people expect
x86_64-unknown-linux-gnu to work on
x86_64-pc-windows-gnu, for instance; you'd need a separate build of core for that target. So I don't see any obvious issue with having a
core::os module that contains additional target-specific items, which doesn't exist on other targets.
In any case, I think this is getting a little off-topic from the original point.
I'd very much like to see
syscall functions introduced into Rust's standard library. I'd be happy to help.