github.com/chenzhuoyu/iasm@v0.9.1/repl/tty.go (about)

     1  package repl
     2  
     3  import (
     4      `syscall`
     5      `unsafe`
     6  )
     7  
     8  func isatty(fd uintptr) bool {
     9      var v syscall.Termios
    10      _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlCode, uintptr(unsafe.Pointer(&v)), 0, 0, 0)
    11      return err == 0
    12  }