Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions components/lwp/terminal/freebsd/tty_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,20 @@ int lwp_tty_ioctl_adapter(lwp_tty_t tp, int cmd, int oflags, void *args, rt_thre
error = (IOCTL(FIONREAD, args, fflags, td));
break;

#ifdef USING_BSD_IOCTL_EXT
/* TIOCLINUX */
case TIOCLINUX:
{
/*
* Linux uses TIOCLINUX to obtain console keyboard modifier
* state. RT-Thread serial consoles do not expose that state,
* but applications such as mc only need this ioctl to be
* harmless when it is unavailable.
*/
unsigned char modifiers = 0;
error = _copy_to_user(args, &modifiers, sizeof(modifiers));
break;
}

#ifdef USING_BSD_IOCTL_EXT
case TIOCCONS:
args->cmd = TIOCCONS;
error = (sys_ioctl(td, (struct ioctl_args *)args));
Expand Down
7 changes: 5 additions & 2 deletions components/lwp/terminal/tty_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,11 @@ static void tty_init_termios(lwp_tty_t tp)
t->__c_ispeed = TTYDEF_SPEED;
t->__c_ospeed = TTYDEF_SPEED;

memcpy(&t->c_cc, tty_ctrl_charset,
sizeof(tty_ctrl_charset) / sizeof(tty_ctrl_charset[0]));
/* Keep terminal consumers usable when the host cannot report a size. */
tp->t_winsize.ws_row = 24;
tp->t_winsize.ws_col = 80;

memcpy(&t->c_cc, tty_ctrl_charset, sizeof(tty_ctrl_charset));

#ifdef USING_BSD_INIT_LOCK_DEVICE
tp->t_termios_init_out = *t;
Expand Down
Loading