mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
b5d18c0d28
This is a follow-up for 8da9502df6
13 lines
270 B
Go
13 lines
270 B
Go
//go:build darwin || freebsd || openbsd
|
|
// +build darwin freebsd openbsd
|
|
|
|
package terminal
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
const ioctlReadTermios = unix.TIOCGETA
|
|
|
|
func isTerminal(fd int) bool {
|
|
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
return err == nil
|
|
}
|