-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
(exa PR) 1190: Fix device major minor numbers #13
Conversation
This is meant as the final step in fixing ogham/exa#1126. The different build targets of Rust libc's `major()` and `minor()` functions have conflicting return types like `c_uint`, `c_int` and `i32`, so an `i64` should be able to represent all of them.
pub major: i64, | ||
pub minor: i64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering libc defines pub type c_uint = u32;
, I don't see the reason for using i64
, would this ever be negative? https://docs.rs/libc/latest/libc/type.c_uint.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be to make space for this difference:
# Linux
pub type dev_t = u64;
pub fn major(dev: ::dev_t) -> ::c_uint;
pub fn minor(dev: ::dev_t) -> ::c_uint;
# macOS
pub type dev_t = i32;
pub fn major(dev: dev_t) -> i32;
pub fn minor(dev: dev_t) -> i32;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this ever be negative?
For glibc, I guess it won't be.
I guess the original intent might have been to have space enough for both pub fn major(dev: dev_t) -> i32;
and pub fn major(dev: ::dev_t) -> ::c_uint;
(u32)?
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This was super helpful to understand what's going on for future reference: ogham/exa#1126 (comment) |
In order to progress on this we'd need feedback from someone with an apple box |
For macOS, I am not sure if the major can be negative, but the minor won't be, see: |
This reverts commit b1e642c.
For potential testers:
|
I found an apple laptop to test this on:
|
This needs an apple user to work on these changes. |
This pull request is stale because it has been open for 30 days with no activity. |
This pull request was closed because it has been inactive for 14 days since being marked as stale. |
ogham/exa#1190