cpjreynolds / rustty

A terminal UI library
https://docs.rs/rustty
MIT License
152 stars 14 forks source link

Does not build on OpenBSD #49

Open vext01 opened 7 years ago

vext01 commented 7 years ago

Hi,

I'm really new to rust, so sorry if this is a fault of libc, and not rustty:

error[E0425]: unresolved name `libc::TIOCGWINSZ`
  --> /home/edd/.cargo/registry/src/github.com-1ecc6299db9ec823/rustty-0.1.12/src/core/termctl.rs:52:49
   |
52 |         let res = unsafe { libc::ioctl(self.fd, libc::TIOCGWINSZ, &mut ws) };
   |                                                 ^^^^^^^^^^^^^^^^ unresolved name

On OpenBSD, that macro should be defined:

sys/ttycom.h
116:#define     TIOCGWINSZ      _IOR('t', 104, struct winsize)  /* get window size */
cpjreynolds commented 7 years ago

Huh, looks to be an oversight in the libc crate. I'll submit a pull request shortly to fix this! Thank you for bringing this to my attention.