2014-11-25 06:49:01 -05:00
|
|
|
// +build !windows
|
2014-11-21 08:12:03 -05:00
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package term // import "github.com/docker/docker/pkg/term"
|
2014-11-21 08:12:03 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|