-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ls: device number for BSDs and solarishOS #4841
Conversation
It would be nice to have tests for this. At least freebsd |
Yes, I agree:) Will do this later |
tests/by-util/test_ls.rs
Outdated
let dev_dir = read_dir("/dev").unwrap(); | ||
// let's use the first device for test | ||
let blk_dev = dev_dir | ||
.map(|res_entry| res_entry.unwrap()) | ||
.find(|entry| entry.file_type().unwrap().is_block_device()) | ||
.expect("Expect a block device"); |
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.
I originally wanted to use the block device that the $PWD
is on, finding that there is no portable way to do it programmatically, so let's just use the first block device under /dev
@@ -3393,3 +3393,42 @@ fn test_tabsize_formatting() { | |||
.succeeds() | |||
.stdout_is("aaaaaaaa bbbb\ncccc dddddddd"); | |||
} | |||
|
|||
#[cfg(any( |
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.
isn't it just unix ? :)
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.
They contain most UNIX OSes, but there are exceptions like haiku
, Redox
refers to libc/src/unix
For |
GNU testsuite comparison:
|
Android is removed from the test as we don't have permission to read |
Tests passed, friendly ping @sylvestre, can I trouble u for another review:) |
With libc#2999 merged, we can finally add device numbers support to other platforms:)
What does this PR do
ls -l
device number support for BSDs and SolarishOSFor the list in this comment,
Redox
does not have thesemajor/minor
things(yet, I guess), other platforms are all supported, so we can close #2140.