This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] PPC termios.h redefined XTABS to match POSIX
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com, Dwayne McConnell <dgm69 at us dot ibm dot com>, janis187 at us dot ibm dot com
- Date: Wed, 12 May 2004 14:36:25 -0500
- Subject: [PATCH] PPC termios.h redefined XTABS to match POSIX
- Organization: IBM LTC
- Reply-to: sjmunroe at vnet dot ibm dot com
Paul MacKerras wrote:
> It turns out that we are not handling the TABDLY bits of the termios
> c_oflag field correctly on PPC, PPC64 and Alpha. These three
> architectures have a value for XTABS that is different from the TAB3
> value. POSIX specifies that setting the TABDLY field to TAB3 should
> result in tabs being expanded to spaces. In n_tty.c:opost() we check
> for O_TABDLY(tty) == XTABS, which is fine on most architectures
> because they have XTABS == TAB3.
>
> I think the right thing to do is just to change the definition of
> XTABS to be the same as TAB3 on these architectures. The patch below
> does this for PPC and PPC64 (and I suggest the Alpha maintainer should
> do the same). At the moment, applications using either the XTABS or
> TAB3 values won't get the expected behaviour. With this patch, apps
> that use TAB3 will get the expected behaviour. Apps that use XTABS
> will need to be recompiled (but note that the POSIX-specified name to
> use is TAB3 not XTABS).
The concensus is that the PPC kernel never expanded tabs correctly
(until now) so we are not breaking existing applications by changing
this. No need for kernel_features or versioning.
This patch matches glibc termios.h definitions with the lastest kernel.
2004-05-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h (XTABS): Define XTABS
equal to TAB3.
diff -urN libc23-cvstip-20040512/sysdeps/unix/sysv/linux/powerpc/bits/termios.h libc23/sysdeps/unix/sysv/linux/powerpc/bits/termios.h
--- libc23-cvstip-20040512/sysdeps/unix/sysv/linux/powerpc/bits/termios.h 2004-03-31 02:53:30.000000000 -0600
+++ libc23/sysdeps/unix/sysv/linux/powerpc/bits/termios.h 2004-05-12 14:17:18.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2001,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2001,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -102,6 +102,7 @@
#define TAB1 00002000
#define TAB2 00004000
#define TAB3 00006000
+#define XTABS 00006000 /* Required by POSIX to be == TAB3. */
#define CRDLY 00030000
#define CR0 00000000
#define CR1 00010000
@@ -116,7 +117,6 @@
#define VTDLY 00200000
#define VT0 00000000
#define VT1 00200000
-#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
/* c_cflag bit meaning */
#define CBAUD 0000377