| Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | // +build linux aix |
| 2 | |||||
| 3 | package logrus | ||||
| 4 | |||||
| 5 | import "golang.org/x/sys/unix" | ||||
| 6 | |||||
| 7 | const ioctlReadTermios = unix.TCGETS | ||||
| 8 | |||||
| 9 | func isTerminal(fd int) bool { | ||||
| 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) | ||||
| 11 | return err == nil | ||||
| 12 | } | ||||
| 13 | |||||