github.com/turingchain2020/turingchain@v1.1.21/common/log/log15/term/terminal_solaris.go (about) 1 // Copyright Turing Corp. 2018 All Rights Reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package term 6 7 import "golang.org/x/sys/unix" 8 9 // IsTty returns true if the given file descriptor is a terminal. 10 func IsTty(fd uintptr) bool { 11 _, err := unix.IoctlGetTermios(int(fd), unix.TCGETA) 12 return err == nil 13 }