2020-05-09 11:28:17 -04:00
|
|
|
// +build !windows,!illumos,!solaris
|
2017-05-10 18:41:46 -04:00
|
|
|
|
2020-04-16 05:23:37 -04:00
|
|
|
package term
|
2017-05-10 18:41:46 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"unsafe"
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
)
|
|
|
|
|
|
|
|
func tcget(fd uintptr, p *Termios) syscall.Errno {
|
|
|
|
_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p)))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func tcset(fd uintptr, p *Termios) syscall.Errno {
|
|
|
|
_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p)))
|
|
|
|
return err
|
|
|
|
}
|