This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[patch] linux/speed.c
- To: GNU C Library <libc-alpha at sourceware dot cygnus dot com>
- Subject: [patch] linux/speed.c
- From: Ben Collins <bcollins at debian dot org>
- Date: Sun, 10 Jun 2001 00:10:28 -0400
Currently sparc-linux target fails to compile because of a change in
linux/speed.c which uses the B400000 define as the max for baud rate.
Sparc only defines up to B200000. I checked the kernel headers, and
indeed the sparc termbits.h has these commented out with something about
not being supported. I'm trying to find out if this is still the case,
but in the mean time, I'd like to propose this patch.
2001-06-09 Ben Collins <bcollins@debian.org>
* sysdeps/unix/sysv/linux/bits/termios.h: Define __MAX_BAUD.
* sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* sysdeps/unix/sysv/linux/speed.c: Use __MAX_BAUD instead of
hardcoded B400000.
--
-----------=======-=-======-=========-----------=====------------=-=------
/ Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
`---=========------=======-------------=-=-----=-===-======-------=--=---'
--- sysdeps/unix/sysv/linux/speed.c~ 2001/06/01 08:09:12 1.10
+++ sysdeps/unix/sysv/linux/speed.c 2001/06/10 03:57:06
@@ -60,7 +60,7 @@
speed_t speed;
{
if ((speed & ~CBAUD) != 0
- && (speed < B57600 || speed > B4000000))
+ && (speed < B57600 || speed > __MAX_BAUD))
{
__set_errno (EINVAL);
return -1;
@@ -82,7 +82,7 @@
speed_t speed;
{
if ((speed & ~CBAUD) != 0
- && (speed < B57600 || speed > B4000000))
+ && (speed < B57600 || speed > __MAX_BAUD))
{
__set_errno (EINVAL);
return -1;
--- sysdeps/unix/sysv/linux/alpha/bits/termios.h~ 1999/01/19 12:20:04 1.3
+++ sysdeps/unix/sysv/linux/alpha/bits/termios.h 2001/06/10 03:57:08
@@ -150,6 +150,8 @@
#define B3500000 00035
#define B4000000 00036
+#define __MAX_BAUD B4000000
+
#define CSIZE 00001400
#define CS5 00000000
#define CS6 00000400
--- sysdeps/unix/sysv/linux/bits/termios.h~ 1999/01/19 12:22:44 1.6
+++ sysdeps/unix/sysv/linux/bits/termios.h 2001/06/10 03:57:09
@@ -165,6 +165,7 @@
#define B3000000 0010015
#define B3500000 0010016
#define B4000000 0010017
+#define __MAX_BAUD B4000000
#ifdef __USE_MISC
# define CIBAUD 002003600000 /* input baud rate (not used) */
# define CRTSCTS 020000000000 /* flow control */
--- sysdeps/unix/sysv/linux/mips/bits/termios.h~ 2000/02/08 13:41:37 1.4
+++ sysdeps/unix/sysv/linux/mips/bits/termios.h 2001/06/10 03:57:10
@@ -214,6 +214,7 @@
# define B3000000 0010015
# define B3500000 0010016
# define B4000000 0010017
+# define __MAX_BAUD B4000000
# define CIBAUD 002003600000 /* input baud rate (not used) */
# define CRTSCTS 020000000000 /* flow control */
#endif
--- sysdeps/unix/sysv/linux/powerpc/bits/termios.h~ 1999/10/29 20:23:15 1.5
+++ sysdeps/unix/sysv/linux/powerpc/bits/termios.h 2001/06/10 03:57:11
@@ -154,6 +154,7 @@
#define B3000000 00034
#define B3500000 00035
#define B4000000 00036
+#define __MAX_BAUD B4000000
#define CSIZE 00001400
#define CS5 00000000
--- sysdeps/unix/sysv/linux/sparc/bits/termios.h~ 2000/02/17 18:35:47 1.7
+++ sysdeps/unix/sysv/linux/sparc/bits/termios.h 2001/06/10 03:58:43
@@ -156,6 +156,7 @@
#define B1152000 0x0000100d
#define B1500000 0x0000100e
#define B2000000 0x0000100f
+#define __MAX_BAUD B2000000
#define CIBAUD 0x100f0000 /* input baud rate (not used) */
#define CMSPAR 0x40000000 /* mark or space (stick) parity */