Thread (60 messages) 60 messages, 5 authors, 2021-10-17

Re: [PATCH 18/23] termios.3: SPARC architecture has 4 different Bnnn constants

From: Michael Kerrisk (man-pages) <hidden>
Date: 2021-08-08 20:36:51

Hello Pai and Alex

@Pali Thanks so much for these fixes to termios(3) and ioctl_tty(2)!

On 8/8/21 10:41 AM, Alejandro Colomar wrote:
From: Pali Rohár <pali@kernel.org>

SPARC is special, it does not have Bnnn constants for baud rates above
2000000. Instead it defines 4 Bnnn constants with smaller baud rates.

This difference between SPARC and non-SPARC architectures is present in
both glibc API (termios.h) and also kernel ioctl API (asm/termbits.h).

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <redacted>
Patch applied.

Cheers,

Michael
quoted hunk ↗ jump to hunk
---
 man3/termios.3 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff --git a/man3/termios.3 b/man3/termios.3
index 4fbd34a52..8c88c25e4 100644
--- a/man3/termios.3
+++ b/man3/termios.3
@@ -953,6 +953,24 @@ to by \fItermios_p\fP to \fIspeed\fP, which must be one of these constants:
 	B1152000
 	B1500000
 	B2000000
+.ft P
+.fi
+.PP
+These constants are additionally supported on the SPARC architecture:
+.PP
+.nf
+.ft B
+	B76800
+	B153600
+	B307200
+	B614400
+.ft P
+.fi
+.PP
+These constants are additionally supported on non-SPARC architectures:
+.PP
+.nf
+.ft B
 	B2500000
 	B3000000
 	B3500000
@@ -960,6 +978,11 @@ to by \fItermios_p\fP to \fIspeed\fP, which must be one of these constants:
 .ft P
 .fi
 .PP
+Due to differences between architectures, portable applications should check
+if a particular
+.BI B nnn
+constant is defined prior to using it.
+.PP
 The zero baud rate,
 .BR B0 ,
 is used to terminate the connection.

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help