Elektrine lite

← Feed

@josh@social.joshtriplett.org

Post #1887738

2026-04-25 19:44 UTC

I wouldn't say "happily". Rust standard library folks are very well aware of the ideal of doing fd-based operations whenever possible, and we'd love to. Linux is doing great work on adding ways to do everything one might want to do using fds. However, we can't force people to run on exclusively modern Linux, as opposed to old Linux or other OSes. And it's much more challenging to design *portable* interfaces around fds without accepting capability limitations or lowest-common-denominator. We could probably make an extremely capable interface, if we stuck most of it in `std::os::linux`, and had some of it fail if run on older Linux.

Replies (2)

  • @siosm@floss.social 2026-04-26 06:44

    @josh @swick @pid_eins As far as I know, the cap-std crate (https://github.com/bytecodealliance/cap-std) does what is explained in the blog post, using an API that is close to the standard library. We use it a lot in bootc and related projects.

    Open ##1887739

  • @pid_eins@mastodon.social 2026-04-29 13:14

    @josh @swick yeah, i don't buy into that race to the bottom thinking. Designing stuff with the shittiest model in mind instead of the best is just awful engineering. Always figure out where you want to be, i.e. go for the summit — and then fill in the gaps/degrade gracefully where you have to on worse systems. But that's really not what rust is doing there. It's letting itself be held hostage by the worst system, and let's that heavily leak into its APIs...

    Open ##1887740