Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

19 wiersze
415 B

  1. // +build darwin freebsd openbsd netbsd
  2. // +build !appengine
  3. package isatty
  4. import (
  5. "syscall"
  6. "unsafe"
  7. )
  8. const ioctlReadTermios = syscall.TIOCGETA
  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. }