diff options
Diffstat (limited to 'lib/posix/termios.nim')
-rw-r--r-- | lib/posix/termios.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/posix/termios.nim b/lib/posix/termios.nim index b03ce74f3..7fb6bb81c 100644 --- a/lib/posix/termios.nim +++ b/lib/posix/termios.nim @@ -7,7 +7,7 @@ # distribution, for details about the copyright. # -import posix +import std/posix type Speed* = cuint @@ -237,8 +237,11 @@ proc tcFlow*(fd: cint; action: cint): cint {.importc: "tcflow", header: "<termios.h>".} # Get process group ID for session leader for controlling terminal FD. -# Window size ioctl. Should work on on any Unix that xterm has been ported to. -var TIOCGWINSZ*{.importc, header: "<sys/ioctl.h>".}: culong +# Window size ioctl. Solaris based systems have an uncommen place for this. +when defined(solaris) or defined(sunos): + var TIOCGWINSZ*{.importc, header: "<sys/termios.h>".}: culong +else: + var TIOCGWINSZ*{.importc, header: "<sys/ioctl.h>".}: culong when defined(nimHasStyleChecks): {.push styleChecks: off.} |