this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement TIOCGLTC and TIOCSLTC ioctls

+39 -1
+37 -1
src/kernel/emulation/linux/ioctl/termios.c
··· 1 1 #include "termios.h" 2 - #include "../../../../../platform-include/sys/errno.h" 2 + #include <sys/errno.h> 3 3 #include <stddef.h> 4 4 #include <stdint.h> 5 5 #include <stdbool.h> 6 + #include <sys/ioctl_compat.h> 6 7 #include "../simple.h" 7 8 8 9 #define USE_OLD_TTY ··· 160 161 out.c_cc[LINUX_VSTOP] = in->t_stopc; 161 162 out.c_cc[LINUX_VEOF] = in->t_eofc; 162 163 out.c_cc[LINUX_VEOL2] = in->t_brkc; 164 + 165 + *retval = __real_ioctl(fd, LINUX_TCSETS, &out); 166 + 167 + return IOCTL_HANDLED; 168 + } 169 + case BSD_TIOCGLTC: 170 + { 171 + struct linux_termios in; 172 + struct ltchars* out = (struct ltchars*) arg; 173 + 174 + *retval = __real_ioctl(fd, LINUX_TCGETS, &in); 175 + 176 + out->t_suspc = in.c_cc[LINUX_VSUSP]; 177 + out->t_dsuspc = in.c_cc[LINUX_VSUSP]; 178 + out->t_rprntc = in.c_cc[LINUX_VREPRINT]; 179 + out->t_flushc = in.c_cc[LINUX_VEOL2]; 180 + out->t_werasc = in.c_cc[LINUX_VWERASE]; 181 + out->t_lnextc = in.c_cc[LINUX_VLNEXT]; 182 + 183 + return IOCTL_HANDLED; 184 + } 185 + case BSD_TIOCSLTC: 186 + { 187 + struct linux_termios out; 188 + const struct ltchars* in = (const struct ltchars*) arg; 189 + 190 + // Get existing values so that we don't overwrite many 191 + // of the parameters not specified in struct ltchars. 192 + __real_ioctl(fd, LINUX_TCGETS, &out); 193 + 194 + out.c_cc[LINUX_VSUSP] = in->t_suspc; 195 + out.c_cc[LINUX_VREPRINT] = in->t_rprntc; 196 + out.c_cc[LINUX_VEOL2] = in->t_flushc; 197 + out.c_cc[LINUX_VWERASE] = in->t_werasc; 198 + out.c_cc[LINUX_VLNEXT] = in->t_lnextc; 163 199 164 200 *retval = __real_ioctl(fd, LINUX_TCSETS, &out); 165 201
+2
src/kernel/emulation/linux/ioctl/termios.h
··· 136 136 #define BSD_TIOCPTYGRANT BSD_IO('t', 84) 137 137 #define BSD_TIOCPTYGNAME BSD_IOC(BSD_IOC_OUT, 't', 83, 128) 138 138 #define BSD_TIOCPTYUNLK BSD_IO('t', 82) 139 + #define BSD_TIOCGLTC 0x40067474 140 + #define BSD_TIOCSLTC 0x80067475 139 141 140 142 #define BSD_IGNBRK 0x00000001 141 143 #define BSD_BRKINT 0x00000002