// +build linuxpackageisattyimport("syscall""unsafe")constioctlReadTermios=syscall.TCGETS// IsTerminal return true if the file descriptor is terminal.funcIsTerminal(fduintptr)bool{vartermiossyscall.Termios_,_,err:=syscall.Syscall6(syscall.SYS_IOCTL,fd,ioctlReadTermios,uintptr(unsafe.Pointer(&termios)),0,0,0)returnerr==0}