VictoriaMetrics/app/vmctl/terminal/unix_bsd.go
2023-04-06 17:09:07 -07:00

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
}