oconnor663 / os_pipe.rs

a cross-platform library for opening OS pipes in Rust
MIT License
100 stars 16 forks source link

add illumos and Solaris support #19

Closed jclulow closed 4 years ago

jclulow commented 4 years ago

With this change, I'm able to get the tests to pass on an illumos system.

$ uname -o
illumos

$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running target/debug/deps/os_pipe-4e54df13c69a5c73

running 9 tests
test tests::test_debug ... ok
test tests::test_parent_handles_dont_close ... ok
test tests::test_pipe_no_data ... ok
test tests::test_pipe_some_data_with_refs ... ok
test tests::test_pipe_some_data ... ok
test tests::test_try_clone ... ok
test tests::test_pipe_a_megabyte_of_data_from_another_thread ... ok
test tests::test_pipes_are_not_inheritable ... ok
test tests::test_parent_handles ... ok

test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/cat-23bddc2238a1b3d1

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/cat_both-6182c20994663f1a

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/swap-4a4cb57d9bce86f2

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests os_pipe

running 1 test
test src/lib.rs -  (line 46) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Our heritage is (from long ago) in OpenSolaris. I've checked the Oracle Solaris manual page and they appear to support the requisite flags for pipe2(). I am not able to test this on Solaris myself at the moment.

oconnor663 commented 4 years ago

What do you think, would it be better to turn this into an "anyone other than Darwin and iOS is assumed to support pipe2()" thing, instead of the current whitelist? Presumably more OS's will get added over time?

oconnor663 commented 4 years ago

Also cool to hear from someone at Oxide, sounds like you all are doing some fun stuff :)

jclulow commented 4 years ago

What do you think, would it be better to turn this into an "anyone other than Darwin and iOS is assumed to support pipe2()" thing, instead of the current whitelist? Presumably more OS's will get added over time?

That sounds like a great plan, and should avoid the need for this sort of PR on at least future UNIX variants. I've pushed a commit that instead just negates the condition for the Darwin implementation.

Also cool to hear from someone at Oxide, sounds like you all are doing some fun stuff :)

Thanks, haha -- definitely having a blast! :D

jclulow commented 4 years ago

Hi there! When you get a chance, can you let me know if this latest version of the change is what you were after? Thanks.

oconnor663 commented 4 years ago

Oops, I dropped the ball!

oconnor663 commented 4 years ago

Released as version 0.9.2. Thank you!