提交 0c9bcefc 编写于 作者: mysterywolf's avatar mysterywolf

[ioctl] 增加TIOCGWINSZ功能

上级 849c99d2
......@@ -1113,9 +1113,19 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
struct winsize* p_winsize;
p_winsize = (struct winsize*)args;
rt_enter_critical();
rt_kprintf("\x1b[8;%d;%dt", p_winsize->ws_col, p_winsize->ws_row);
rt_exit_critical();
}
break;
case TIOCGWINSZ:
{
struct winsize* p_winsize;
p_winsize = (struct winsize*)args;
/* TODO: get windows size from console */
p_winsize->ws_col = 80;
p_winsize->ws_row = 24;
p_winsize->ws_xpixel = 0;/*unused*/
p_winsize->ws_ypixel = 0;/*unused*/
}
break;
#endif /*RT_USING_POSIX_TERMIOS*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册