2020-09-15 10:00:50 -04:00
|
|
|
// +build !windows
|
2014-11-21 08:12:03 -05:00
|
|
|
|
2020-04-16 05:02:09 -04:00
|
|
|
package term
|
2014-11-21 08:12:03 -05:00
|
|
|
|
|
|
|
import (
|
2017-05-04 20:52:19 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2014-11-21 08:12:03 -05:00
|
|
|
)
|
|
|
|
|
2020-09-15 10:00:50 -04: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 08:12:03 -05:00
|
|
|
}
|
|
|
|
|
2020-09-15 10:00:50 -04:00
|
|
|
func tcset(fd uintptr, p *Termios) error {
|
|
|
|
return unix.IoctlSetTermios(int(fd), setTermios, p)
|
2014-11-21 08:12:03 -05:00
|
|
|
}
|