From 82cf43dd887801b8b22b8aae8c02854d921915d5 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Fri, 24 May 2019 18:07:22 -0700 Subject: Update libc crate to 0.2.55 This change updates the libc crate to version 0.2.55. Import subrepo libc/:libc at caf17a0641d29dc624621177f5756804dd180c13 --- libc/src/unix/solarish/compat.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libc/src/unix/solarish/compat.rs (limited to 'libc/src/unix/solarish/compat.rs') diff --git a/libc/src/unix/solarish/compat.rs b/libc/src/unix/solarish/compat.rs new file mode 100644 index 0000000..8631d60 --- /dev/null +++ b/libc/src/unix/solarish/compat.rs @@ -0,0 +1,21 @@ +// Common functions that are unfortunately missing on illumos and +// Solaris, but often needed by other crates. + +use unix::solarish::*; + +pub unsafe fn cfmakeraw(termios: *mut ::termios) { + let mut t = *termios as ::termios; + t.c_iflag &= !(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); + t.c_oflag &= !OPOST; + t.c_lflag &= !(ECHO|ECHONL|ICANON|ISIG|IEXTEN); + t.c_cflag &= !(CSIZE|PARENB); + t.c_cflag |= CS8; +} + +pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int { + // Neither of these functions on illumos or Solaris actually ever + // return an error + ::cfsetispeed(termios, speed); + ::cfsetospeed(termios, speed); + 0 +} -- cgit v1.2.1