Use termios via CGO only on Linux
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
This commit is contained in:
parent
92251ceb7b
commit
c1532556b2
4 changed files with 3 additions and 6 deletions
19
term/tc_other.go
Normal file
19
term/tc_other.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
// +build !windows
|
||||
// +build !linux !cgo
|
||||
|
||||
package term
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func tcget(fd uintptr, p *Termios) syscall.Errno {
|
||||
_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p)))
|
||||
return err
|
||||
}
|
||||
|
||||
func tcset(fd uintptr, p *Termios) syscall.Errno {
|
||||
_, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p)))
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue