-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rustix instead of libc #10
Conversation
Did this affect overall build time? I'm not so familiar with rustic, but I do know that its alternative nix is rather heavy which is why I went for libc initially. |
And what about the BSDs and macOS? Is your implementation also correct on these systems? |
On my machine using the latest stable
I added references that describe the implementation on BSD as well. |
What's the difference here on GitHub? Can you check the latest build for main versus this merge request? |
Oh and would you mind to sign your commits? 🙂 |
My bad, I meant
Sure! Just did that |
Can you rebase on I'm still not sure whether I'd like to merge this, and I'd like to see it build on Github actions first. 0.6s to 3s is five times slower, that's quite a bit. I really like that the code's much shorter, easier to understand and doesn't have an |
I think I'll pass this one. It did have a noticable impact on the build time:
Not sure if it's a fluke, but I don't think that saving a few instructions and removing one line of |
Rather than using
libc::gethostname
, this PR modifies this crate to use therustix
crate. On Linux,rustix
uses raw system calls instead of going throughlibc
, which can lead to lower instruction counts. This also removes unsafe code from this crate to boot.gethostname()
is implemented in both glibc and musl by callinguname()
and getting thenodename
, so that's how I implemented it here.