aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/sirupsen/logrus/terminal_check_unix.go
blob: 04748b8515f16d576c9d791a93d4483ec330dea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// +build linux aix zos
// +build !js

package logrus

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

const ioctlReadTermios = unix.TCGETS

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