summaryrefslogtreecommitdiff
path: root/test/tools/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go
blob: ff6ff7b9939eb0d77e203943461fe0d4ae714e3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// +build darwin dragonfly freebsd netbsd openbsd

package logrus

import "golang.org/x/sys/unix"

const ioctlReadTermios = unix.TIOCGETA

func isTerminal(fd int) bool {
	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
	return err == nil
}