Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.7k
Why is libc used?#5507
-
I have no experience with developing such binaries so please excuse the ignorance. It looks like the usage of RedoxOS developers have an incomplete rewrite of libc (relibc), but is libc absolutely necessary? Is libc a shortcut to the implementation of certain features too complicated to implement in rust? Is rewriting those parts of libc out of scope of the project? |
BetaWas this translation helpful?Give feedback.
All reactions
Oh good question! You're gonna get a long answer 😄
We have to do syscalls somewhere, which means that somewhere in our dependency tree, there'sunsafe. Either we useunsafe ourselves or we let some library do it for us.libc is used throughout the Rust ecosystem, even in the standard library. This also means that we are always usinglibc indirectly throughstd already. It is usually the recommended way to deal with low-level stuff, becauselibc standardizes behaviour across many platforms. However, that doesn't mean that we're stuck withlibc! We want to use as many safe abstractions overlibc as possible. Thenix crate, for example, provides safe APIs overlibc. We also (indirectly) user…
Replies: 1 comment 1 reply
-
Oh good question! You're gonna get a long answer 😄 We have to do syscalls somewhere, which means that somewhere in our dependency tree, there's Developing a libc alternative is definitely out of scope for this project, but we try to help out a bit with some of the projects I've mentioned when we need them. Also note that |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you! That's the detail I was looking for 👍 |
BetaWas this translation helpful?Give feedback.