Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

17 lignes
402 B

  1. // +build solaris
  2. // +build !appengine
  3. package isatty
  4. import (
  5. "golang.org/x/sys/unix"
  6. )
  7. // IsTerminal returns true if the given file descriptor is a terminal.
  8. // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c
  9. func IsTerminal(fd uintptr) bool {
  10. var termio unix.Termio
  11. err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio)
  12. return err == nil
  13. }