2014-11-25 06:49:01 -05:00
|
|
|
// +build !windows
|
2016-04-15 14:28:44 -04:00
|
|
|
// +build !solaris !cgo
|
2014-11-21 08:12:03 -05:00
|
|
|
|
|
|
|
package term
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"unsafe"
|
2017-05-04 20:52:19 -04:00
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
2014-11-21 08:12:03 -05: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 08:12:03 -05: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 08:12:03 -05:00
|
|
|
return err
|
|
|
|
}
|