github.com/pubgo/xprocess@v0.1.11/xprocess_isatty/isatty_solaris.go (about) 1 // +build solaris 2 // +build !appengine 3 4 package xprocess_isatty 5 6 import ( 7 "golang.org/x/sys/unix" 8 ) 9 10 // IsTerminal returns true if the given file descriptor is a terminal. 11 // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 func IsTerminal(fd uintptr) bool { 13 var termio unix.Termio 14 err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 return err == nil 16 } 17 18 // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 // terminal. This is also always false on this environment. 20 func IsCygwinTerminal(fd uintptr) bool { 21 return false 22 }