code: func GetState(fd int) (*State, error) {
  	var oldState State
  	if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 {
  		return nil, err
  	}
  
  	return &oldState, nil
  }
docs: // GetState returns the current state of a terminal which may be useful to
  // restore the terminal after a signal.