2014-11-25 20:49:01 +09:00
|
|
|
// +build !windows
|
2016-04-15 11:28:44 -07:00
|
|
|
// +build !solaris !cgo
|
2014-11-21 22:12:03 +09:00
|
|
|
|
|
|
|
package term
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"unsafe"
|
2017-05-04 20:52:19 -04:00
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
2014-11-21 22:12:03 +09:00
|
|
|
)
|
|
|
|
|
|
|
|
func tcget(fd uintptr, p *Termios) syscall.Errno {
|
2017-05-04 20:52:19 -04:00
|
|
|
_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p)))
|
2014-11-21 22:12:03 +09:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func tcset(fd uintptr, p *Termios) syscall.Errno {
|
2017-05-04 20:52:19 -04:00
|
|
|
_, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p)))
|
2014-11-21 22:12:03 +09:00
|
|
|
return err
|
|
|
|
}
|