isatty_linux_ppc64x.go 609 B

12345678910111213141516171819202122232425
  1. // +build linux
  2. // +build ppc64 ppc64le
  3. package isatty
  4. import (
  5. "unsafe"
  6. syscall "golang.org/x/sys/unix"
  7. )
  8. const ioctlReadTermios = syscall.TCGETS
  9. // IsTerminal return true if the file descriptor is terminal.
  10. func IsTerminal(fd uintptr) bool {
  11. var termios syscall.Termios
  12. _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
  13. return err == 0
  14. }
  15. // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
  16. // terminal. This is also always false on this environment.
  17. func IsCygwinTerminal(fd uintptr) bool {
  18. return false
  19. }