4 ms·
Did you try the nix crate? It looks like maybe not. It should have all of that stuff already wrapped for you. For example: https://docs.rs/nix/0.7.0/nix/sys/ter
by steveklabnik 10y ago
Did you try the nix crate? It looks like maybe not. It should have all of that stuff already wrapped for you. For example: https://docs.rs/nix/0.7.0/nix/sys/termios/fn.tcgetattr.html https://docs.rs/nix/0.7.0/nix/sys/termios/fn.tcgetattr.html (select is in there too https://docs.rs/nix/0.7.0/nix/sys/select/fn.select.html https://docs.rs/nix/0.7.0/nix/sys/select/fn.select.html )
rust-bindgen has been improving a ton, and it is in fact on that roadmap, under
> Integration with other languages, running the gamut from C to JavaScript.
- jimrandomh 10y agoHappy to hear bindgen is getting attention; I didn't actually notice that when I looked through the roadmap. I didn't try the nix crate at the time, but looking at it just now - it doesn't solve the portability issue. It defines struct Termios in https://github.com/nix-rust/nix/blob/master/src/sys/termios.rs https://github.com/nix-rust/nix/blob/master/src/sys/termios.... , with something #ifdef-ish branching on operating system, but not on CPU architecture. On quick inspection, I think it's probably incorrect on x86-32, and this crate is definitely a major liability for portability.
- steveklabnik 10y agoSounds like you should open an issue; it's pretty much the crate for safe bindings, but as I'm sure you know, there's a lot of tiny details to get right. (Also, I'll stop here and only reply on our Reddit conversation, ha!)
- jimrandomh 10y agohttps://www.reddit.com/r/rust/comments/5sg9d3/rusts_2017_roadmap/ddf5ly9/ https://www.reddit.com/r/rust/comments/5sg9d3/rusts_2017_roa... (The first few comments are mirrored between here and Reddit.)