On 2021-01-28 03:14, Corinna Vinschen via Cygwin-patches wrote:
On Jan 28 11:08, Corinna Vinschen via Cygwin-patches wrote:
Hi Marek,
thanks for the patch. [...]
index 17e8d83a3..933851c21 100644
--- a/winsup/cygwin/include/sys/termios.h
+++ b/winsup/cygwin/include/sys/termios.h
@@ -185,6 +185,7 @@ POSIX commands */
#define PARODD 0x00200
#define HUPCL 0x00400
#define CLOCAL 0x00800
+#define CMSPAR 0x40000000 /* Mark or space (stick) parity. */
Why did you choose such a big value here? Wouldn't it be nicer just to
follow up with
#define CMSPAR 0x10000
or am I missing something here?
GLIBC/Linux compatibility:
https://sourceware.org/git/?p=glibc.git&a=search&h=HEAD&st=grep&s=define+CMSPAR
sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h
23 #ifdef __USE_MISC
24 # define CBAUD 0000037
25 # define CBAUDEX 0000000
26 # define CMSPAR 010000000000 /* mark or space (stick) parity */
27 # define CRTSCTS 020000000000 /* flow control */
28 #endif
sysdeps/unix/sysv/linux/bits/termios-baud.h
23 #ifdef __USE_MISC
24 # define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */
25 # define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD.
26 (not in POSIX). */
27 # define CIBAUD 002003600000 /* Input baud rate (not used). */
28 # define CMSPAR 010000000000 /* Mark or space (stick) parity. */
29 # define CRTSCTS 020000000000 /* Flow control. */
30 #endif
sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h
23 #ifdef __USE_MISC
24 # define CBAUD 0000377
25 # define CBAUDEX 0000020
26 # define CMSPAR 010000000000 /* mark or space (stick) parity */
27 # define CRTSCTS 020000000000 /* flow control */
28 #endif
sysdeps/unix/sysv/linux/sparc/bits/termios-baud.h
23 #ifdef __USE_MISC
24 # define CBAUD 0x0000100f
25 # define CBAUDEX 0x00001000
26 # define CIBAUD 0x100f0000 /* input baud rate (not used) */
27 # define CMSPAR 0x40000000 /* mark or space (stick) parity */
28 # define CRTSCTS 0x80000000 /* flow control */
29 #endif
Also, on second thought I think CMSPAR should follow CRTSCTS, a few
lines below, because of its numerical value higher than CRTSCTS.
GLIBC/Linux normally has it lower:
$ grep -C2 'define\s\+CMSPAR' /usr/include/**/*.h
/usr/include/asm-generic/termbits.h:
#define B4000000 0010017
#define CIBAUD 002003600000 /* input baud rate */
#define CMSPAR 010000000000 /* mark or space (stick) parity */
#define CRTSCTS 020000000000 /* flow control */
--
/usr/include/i386-linux-gnu/bits/termios.h:
#ifdef __USE_MISC
# define CIBAUD 002003600000 /* input baud rate (not used) */
# define CMSPAR 010000000000 /* mark or space (stick) parity */
# define CRTSCTS 020000000000 /* flow control */
#endif
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]