-
Notifications
You must be signed in to change notification settings - Fork 6
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
move to using rustix instead of custom syscall wrappers #1
Comments
I hadn't seen it, I'll take a look. It might let me get rid of some of the more awful parts of the syscall wrapping code I have. |
From a quick look, I'm not entirely convinced switching makes a lot of sense. My main concern is that there are certain "bad signs" with what flags get passed by default (it's okay for most programs but not for us). It appears to me that there isn't a way to explicitly set flags like (This is just from a few minutes of looking, I'll take a closer look sometime later when I get a chance.) |
All good comments, though I had more hoped the response would be "Let's patch/fix the openat crate". A motivation I have here is I maintain https://crates.io/crates/openat-ext and I have plans to significantly extend it with methods from https://gitlab.gnome.org/GNOME/libglnx/blob/8f34033b256da5a8e2cc66faf8e81cfdfb9cdf37/glnx-fdio.c - things like "atomically replace a file's contents using If there isn't a shared base wrapper for Or I guess, the other approach would be for this crate to take over the role of |
Don't get me wrong, I would be happy to work on patching the Another thing I'm still trying to come to terms with is how much abstraction there is in Rust programs (for a systems programming language at least). I'm not sure how I feel (especially coming from C) about not being sure what the exact syscall arguments being used are. But maybe that's just me still being quite green to Rust overall. I will point out that in
I'm definitely in favour of there being a gold-standard crate for
Probably not the best choice, |
I've posted tailhook/openat#25 and we can see what the maintainer thinks. |
I just came across this issue; in case it's useful, posish is a crate that provides safe low-level wrappers for all the |
Hmm. Another one? I guess I'd hoped for more centralization here...nowadays e.g. nix also has openat. But, your code certainly looks good. |
Yeah; one of the biggest challenges in this space is finding the right abstraction levels 😅 . |
It seems most likely we're going to end up moving everything to |
Have you seen https://crates.io/crates/openat ? I use it in rpm-ostree, curious whether you considered using it instead of rolling custom wrappers here.
The text was updated successfully, but these errors were encountered: