isatty_solaris.go

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