shared/termios/termios_unix.go
func GetState(fd int) (*State, error) {
	termios := syscall.Termios{}

	ret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(&termios)))
	if ret != 0 {
		return nil, err.(syscall.Errno)
	}

	state := State{}
	state.Termios = termios

	return &state, nil
}
func GetState(fd int) (*State, error) {
	termios := syscall.Termios{}

	ret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(&termios)))
	if ret != 0 {
		return nil, err.(syscall.Errno)
	}

	state := State{}
	state.Termios = termios

	return &state, nil
}
// GetState returns the current state of a terminal which may be useful to restore the terminal after a signal.