The stdlib only exposes some syscalls via rust-friendly wrappers, and in a way that is generally a cross-platform subset, sometimes with platform extentions. So the `fs` module (https://doc.rust-lang.org/std/fs/) exposes common file operations across most (all?) supported platforms. Some unix specific file operations are exposed at: https://doc.rust-lang.org/stable/std/os/unix/fs/index.html . These things do a pretty good job for most work, but sometimes you gotta get wierd...
The libc crate allows more direct access to the syscalls on your flavor of *nix by creating a rust-> bridge for them, and exposing the C types directly. This bridge isn't a lot of code, mostly it just does the work of creating a rust function that minimally wraps the external C function. For a lot of low-level software you end up pulling the libc crate to hit your system specific calls.
And for some very system specific calls (e.g. io_uring) you end up having to pull in another crate that calls into that subsystem for you (often pulling in libc also).
All of this ends up being linked to the libc you build against tho.
It does matter, because to get a comparable number from sudo you'd have to count libc. I don't know how many lines of code that is exactly (and e.g. musl or OpenBSD libc is probably smaller than GNU, so there isn't a fixed number to start with), but I bet it's roughly a comparable number, or at least much closer.
As a general point I agree with you, but both sudo and sudo-rs are pretty large.
libc is used by the entire system. It's not a vendored dependency of just sudo. At best, you'd amortize it over everything that uses it to get a reasonable comparison.
Are we not on the trail to doing the same with rust, at least in theory? You don't think someone somewhere has the idea to make an all-rust system eventually? Even without that evetual ultimate expression, if you have even a few rust components in your system and not just sudo alone, then the same point stands. You don't count rust itself any more than you count gcc.
If I remove those the line count is about 100k, which is about the same as sudo.