summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2001-05-25 20:58:22 +0000
committerDavid Schleef <ds@schleef.org>2001-05-25 20:58:22 +0000
commit43989bfe8b133c09a0b57a0a4a2249e64f3bc86d (patch)
tree35fc451b511c9f2f651a8f663e50a7cea67f7386
parenta9c9a68333523b6c840f91725b00f31a4974e891 (diff)
termios test program, since I'm having difficulty on powerpc
-rw-r--r--test/termios/Makefile39
-rw-r--r--test/termios/termios.c24
2 files changed, 63 insertions, 0 deletions
diff --git a/test/termios/Makefile b/test/termios/Makefile
new file mode 100644
index 000000000..69c949a4a
--- /dev/null
+++ b/test/termios/Makefile
@@ -0,0 +1,39 @@
+TESTDIR=../
+include $(TESTDIR)/Rules.mak
+
+
+
+TARGETS=termios termios_glibc
+
+all: $(TARGETS)
+
+termios: termios.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak $(TESTCC)
+ -@ echo "-------"
+ -@ echo " "
+ -@ echo "Compiling vs uClibc: "
+ -@ echo " "
+ $(TESTCC) $(CFLAGS) -c $< -o $@.o
+ $(TESTCC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+ $(STRIPTOOL) -x -R .note -R .comment $@
+ -ldd $@
+ ls $(LSFLAGS) $@
+ -./$@
+ -@ echo " "
+
+termios_glibc: termios.c Makefile
+ -@ echo "-------"
+ -@ echo " "
+ -@ echo "Compiling vs GNU libc: "
+ -@ echo " "
+ $(CC) $(CFLAGS) -c $< -o $@.o
+ $(CC) $(LDFLAGS) $@.o -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $@
+ -ldd $@
+ ls $(LSFLAGS) $@
+ -./$@
+ -@ echo " "
+
+clean:
+ rm -f *.[oa] *~ core $(TARGETS)
+
+
diff --git a/test/termios/termios.c b/test/termios/termios.c
new file mode 100644
index 000000000..250d9eb14
--- /dev/null
+++ b/test/termios/termios.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
+#include <asm/ioctls.h>
+
+int main(int argc,char *argv[])
+{
+ struct termios t;
+ int ret;
+
+ printf("TCGETS = 0x%08x\n",TCGETS);
+ printf("sizeof(struct termios) = %d\n",sizeof(struct termios));
+
+ ret = ioctl(fileno(stdout),TCGETS,&t);
+
+ if(ret<0){
+ perror("ioctl");
+ }else{
+ printf("ioctl returned %d\n",ret);
+ }
+
+ return 0;
+}