use the correct header for TIOCGWINSZ on Solaris (#19037)

This commit is contained in:
BarrOff
2021-10-22 23:42:54 +00:00
committed by GitHub
parent 490c4226a5
commit 6621e1a3ea

View File

@@ -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.}