]> granicus.if.org Git - strace/commitdiff
2003-01-13 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Tue, 14 Jan 2003 07:53:40 +0000 (07:53 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 14 Jan 2003 07:53:40 +0000 (07:53 +0000)
* term.c [LINUX]: Get kernel definition of struct termios.
From Anton Blanchard <anton@samba.org>.

term.c

diff --git a/term.c b/term.c
index 0a741d54f8e527e842b17fadba4ded20809c3d07..5fad3b52f65ccb6780b1b8fe0387381e58ce24f8 100644 (file)
--- a/term.c
+++ b/term.c
 
 #include "defs.h"
 
+#ifdef LINUX
+/*
+ * The C library's definition of struct termios might differ from
+ * the kernel one, and we need to use the kernel layout.
+ */
+#include <linux/termios.h>
+#else
+
 #ifdef HAVE_TERMIO_H
 #include <termio.h>
 #endif /* HAVE_TERMIO_H */
 
 #include <termios.h>
+#endif
 
 #ifdef HAVE_SYS_FILIO_H
 #include <sys/filio.h>
@@ -182,7 +191,7 @@ long code, arg;
        #define TCSETS  TIOCSETA
        #define TCSETSW TIOCSETAW
        #define TCSETSF TIOCSETAF
-#endif 
+#endif
        struct winsize ws;
 #ifdef TIOCGSIZE
        struct  ttysize ts;
@@ -207,7 +216,7 @@ long code, arg;
                        return 0;
                if (abbrev(tcp)) {
                        tprintf(", {");
-#ifndef FREEBSD                        
+#ifndef FREEBSD
                        printxval(baud_options, tios.c_cflag & CBAUD, "B???");
 #else
                        printxval(baud_options, tios.c_ispeed, "B???");
@@ -216,7 +225,7 @@ long code, arg;
                                printxval(baud_options, tios.c_ospeed, "B???");
                                tprintf(" (out)");
                        }
-#endif                 
+#endif
                        tprintf(" %sopost %sisig %sicanon %secho ...}",
                                (tios.c_oflag & OPOST) ? "" : "-",
                                (tios.c_lflag & ISIG) ? "" : "-",
@@ -451,4 +460,3 @@ long code, arg;
                return 0;
        }
 }
-