2020-09-15 16:00:50 +02:00
|
|
|
// +build !windows
|
2014-11-21 22:12:03 +09:00
|
|
|
|
2020-04-16 11:02:09 +02:00
|
|
|
package term
|
2014-11-21 22:12:03 +09:00
|
|
|
|
|
|
|
import (
|
2017-05-04 20:52:19 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2014-11-21 22:12:03 +09:00
|
|
|
)
|
|
|
|
|
2020-09-15 16:00:50 +02:00
|
|
|
func tcget(fd uintptr) (*Termios, error) {
|
|
|
|
p, err := unix.IoctlGetTermios(int(fd), getTermios)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return p, nil
|
2014-11-21 22:12:03 +09:00
|
|
|
}
|
|
|
|
|
2020-09-15 16:00:50 +02:00
|
|
|
func tcset(fd uintptr, p *Termios) error {
|
|
|
|
return unix.IoctlSetTermios(int(fd), setTermios, p)
|
2014-11-21 22:12:03 +09:00
|
|
|
}
|