github.com/lazyboychen7/engine@v17.12.1-ce-rc2+incompatible/pkg/term/tc.go (about)

     1  // +build !windows
     2  
     3  package term
     4  
     5  import (
     6  	"syscall"
     7  	"unsafe"
     8  
     9  	"golang.org/x/sys/unix"
    10  )
    11  
    12  func tcget(fd uintptr, p *Termios) syscall.Errno {
    13  	_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p)))
    14  	return err
    15  }
    16  
    17  func tcset(fd uintptr, p *Termios) syscall.Errno {
    18  	_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p)))
    19  	return err
    20  }