-
Notifications
You must be signed in to change notification settings - Fork 667
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
Add protable wrappers for the block device IOCTLs #1374
Comments
I think this is really beyond the scope of Nix. We define the ioctl macros, but we shouldn't also wrap every single ioctl. There are tons. |
I agree with @asomers. This is good functionality but it might make sense to have it live in its own crate which in turn depends on Nix. The scope of nix itself would be quite large and difficult to maintain if we tried to provide more than basic safety over the lower level calls. In addition, defining a portable API, which is a good goal in general, works against the goals of nix to safely expose the full underlying functionality of supported operating systems. Hopefully these comments make sense. I've personally had use of such functionality on block devices, so an abstraction like this is far from useless. Just might need to find a different home. |
Thanks for fast replies, I was not sure if nix was the right place, for it. I'll look into turning it into a stand alone crate. |
Finally got round to making a block-devs crate with this code, just in case any one else is interested. |
Add a portable and safe way of getting things like the size of block device (e.g. USB sticks or SD cards).
Other people (#1006 & #573) have had issue using the ioctl directly so it would be nice to have a safe simple wrapper.
It should have:
It would be nice to support the other BLK* ioctls
The text was updated successfully, but these errors were encountered: