1
// +build darwin freebsd openbsd netbsd
10
const ioctlReadTermios = syscall.TIOCGETA
12
// IsTerminal return true if the file descriptor is terminal.
13
func IsTerminal(fd uintptr) bool {
14
var termios syscall.Termios
15
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)