This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4ab00971c99ea8f0cbdb027530c1f9c9287e5af8 Author: Marco Casaroli <[email protected]> AuthorDate: Tue Oct 27 09:22:07 2026 +0100 include/termios.h: Make c_cc large enough for every index. VLNEXT (15) and VEOL2 (16) were past the end of c_cc: NCCS was 12, so a program that set c_cc[VLNEXT] or c_cc[VEOL2] wrote into c_speed or into the padding before it. NCCS is now 17, one more than the largest index. Add the indexes VREPRINT, VDISCARD and VWERASE and the local mode ECHOPRT, with the values of Linux (the other indexes and local modes of NuttX already have them). Programs (util-linux, for example) use them without a check. This changes the size of struct termios. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- include/termios.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/termios.h b/include/termios.h index 27a3cc60781..f03ca76a491 100644 --- a/include/termios.h +++ b/include/termios.h @@ -114,6 +114,7 @@ #define NOFLSH (1 << 7) /* Bit 7: Disable flush after interrupt or quit */ #define TOSTOP (1 << 8) /* Bit 8: Send SIGTTOU for background output */ #define ECHOCTL (1 << 9) /* Bit 9: Echo control characters as ^X */ +#define ECHOPRT (1 << 10) /* Bit 10: Echo erased characters (hardcopy) */ #define ECHOKE (1 << 11) /* Bit 11: Visual erase for KILL */ #define FLUSHO (1 << 12) /* Bit 12: Flush output to terminal */ #define IEXTEN (1 << 15) /* Bit 15: Enable extended input character processing */ @@ -139,6 +140,10 @@ * * VMIN: Minimum number of characters for non-canonical read * VTIME: Timeout in deciseconds for non-canonical read + * + * Extensions (not POSIX): VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOL2. The + * indexes are the same as on Linux. NCCS is one more than the largest + * index, so that every index is in the array. */ #define VINTR 0 /* Bit 0: INTR character */ @@ -152,9 +157,12 @@ #define VSTOP 9 /* Bit 9: STOP character */ #define VSUSP 10 /* Bit 10: SUSP character */ #define VEOL 11 /* Bit 11: EOL character (canonical mode) */ -#define NCCS 12 /* Bit 12: Size of the array c_cc for control characters */ +#define VREPRINT 12 /* Bit 12: REPRINT character (canonical mode) */ +#define VDISCARD 13 /* Bit 13: DISCARD character */ +#define VWERASE 14 /* Bit 14: WERASE character (canonical mode) */ #define VLNEXT 15 /* Bit 15: Literal-next character */ #define VEOL2 16 /* Bit 16: Second EOL character */ +#define NCCS 17 /* Bit 17: Size of the array c_cc for control characters */ /* Baud Rate Selection. These are instances of type speed_t. Values of * 38400 and below are specified by POSIX; values above 38400 are sometimes
