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.
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
| .stdout_is("aaaaaaaa bbbb\ncccc dddddddd"); | ||
| } | ||
|
|
||
| #[cfg(any( |
There was a problem hiding this comment.
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 -ldevice number support for BSDs and SolarishOSFor the list in this comment,
Redoxdoes not have thesemajor/minorthings(yet, I guess), other platforms are all supported, so we can close #2140.