Skip to content
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 illumos support #21

Closed
wants to merge 1 commit into from
Closed

Conversation

papertigers
Copy link
Contributor

While trying to build bat on a SmartOS system, I found that termios currently doesn't support illumos.

root - rustdev ~/src/termios-rs (git:mz-illumos) # cargo test
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running target/debug/deps/termios-e986a12baa34d741

running 0 tests

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

   Doc-tests termios

running 10 tests
test src/lib.rs -  (line 44) ... ok
test src/lib.rs -  (line 19) ... ok
test src/lib.rs - Termios (line 152) ... ok
test src/lib.rs -  (line 78) ... ok
test src/lib.rs -  (line 28) ... ok
test src/lib.rs - cfsetspeed (line 361) ... ok
test src/lib.rs - cfgetispeed (line 221) ... ok
test src/lib.rs - cfgetospeed (line 236) ... ok
test src/lib.rs - cfsetispeed (line 278) ... ok
test src/lib.rs - cfsetospeed (line 321) ... ok

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

This should support other Solaris based systems, but I sourced all of the header translations from illumos and I am unable to test on Oracle Solaris. Also I would have just named the target "illumos", but this issue is still being sorted out.

@papertigers
Copy link
Contributor Author

Wondering if anyone has had a chance to look at this yet..

@papertigers
Copy link
Contributor Author

@dcuddeback any chance you could look at / merge this?

@papertigers
Copy link
Contributor Author

Just want to bump this PR again in hopes that it can get merged and I can remove the following from a bunch of local checkouts:

[patch.crates-io]
termios = { git = "https://github.com/papertigers/termios-rs/", branch = "mz-illumos" }

@dcuddeback
Copy link
Owner

Sorry for the long wait time, and thank you everyone for your patience. I've been on hiatus from open source work for a while. And thanks @papertigers for sending in the patch.

I've merge this on the command-line with some changes (ecbab66):

  • Added extern "C" and #[no_mangle] for cfmakeraw() and cfsetspeed() to make them indistinguishable from C functions.
  • Added a bunch of missing c_oflag and c_cflag bits.
  • Dropped B7200, B14400, and B28800. I don't see those in /usr/include/sys/termios.h on OmniOS and I get a compile error when trying to use those in a C program.

I'm not familiar with illumos. If there's something wrong with the changes I made, someone please let me know. I get the impression that there are many different flavors of illumos, similar to how there are many distributions of Linux. I compared this PR against headers from OmniOS Community Edition (I installed the system/headers package).

If there are no issues, I'll cut a release to Cargo after I land the other open PRs.

@dcuddeback dcuddeback closed this Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants