mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 03:26:30 +00:00
20 lines
321 B
Go
20 lines
321 B
Go
|
// +build !windows
|
||
|
|
||
|
package term
|
||
|
|
||
|
import (
|
||
|
"golang.org/x/sys/unix"
|
||
|
)
|
||
|
|
||
|
func tcget(fd uintptr) (*Termios, error) {
|
||
|
p, err := unix.IoctlGetTermios(int(fd), getTermios)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return p, nil
|
||
|
}
|
||
|
|
||
|
func tcset(fd uintptr, p *Termios) error {
|
||
|
return unix.IoctlSetTermios(int(fd), setTermios, p)
|
||
|
}
|