+ // Double-check `fd` describes a terminal
+ if( _SysIOCtl(fd, DRV_IOCTL_TYPE, NULL) != DRV_TYPE_TERMINAL ) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ struct ptymode mode = {0,0};
+
+ if(termios_p->c_lflag & ICANON)
+ mode.InputMode |= PTYIMODE_CANON;
+ if(termios_p->c_lflag & ECHO)
+ mode.InputMode |= PTYIMODE_ECHO;
+
+ _SysDebug("*termios_p = {%x,%x,%x,%x}",
+ termios_p->c_iflag, termios_p->c_oflag, termios_p->c_cflag, termios_p->c_lflag);
+