VictoriaMetrics/app/vmctl/terminal/unix_bsd.go

13 lines
237 B
Go
Raw Permalink Normal View History

//go: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
}