gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

isatty_solaris.go (582B)


      1 //go:build solaris && !appengine
      2 // +build solaris,!appengine
      3 
      4 package 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: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c
     12 func 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.
     19 func IsCygwinTerminal(fd uintptr) bool {
     20 	return false
     21 }