]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/mattn/go-isatty/isatty_bsd.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / mattn / go-isatty / isatty_bsd.go
CommitLineData
15c0b25d
AP
1// +build darwin freebsd openbsd netbsd dragonfly
2// +build !appengine
3
4package isatty
5
6import (
7 "syscall"
8 "unsafe"
9)
10
11const ioctlReadTermios = syscall.TIOCGETA
12
13// IsTerminal return true if the file descriptor is terminal.
14func IsTerminal(fd uintptr) bool {
15 var termios syscall.Termios
16 _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
17 return err == 0
18}
107c1cdb
ND
19
20// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
21// terminal. This is also always false on this environment.
22func IsCygwinTerminal(fd uintptr) bool {
23 return false
24}