summaryrefslogtreecommitdiff
path: root/test/termios
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-24 20:22:12 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-24 20:22:12 +0200
commit7988979a722b4cdf287b2093956a76a3f19b9897 (patch)
treed35e251d0472ceca55a2eef61cff261c8ee68fab /test/termios
add uClibc-ng test directory
Diffstat (limited to 'test/termios')
-rw-r--r--test/termios/Makefile8
-rw-r--r--test/termios/termios.c25
2 files changed, 33 insertions, 0 deletions
diff --git a/test/termios/Makefile b/test/termios/Makefile
new file mode 100644
index 0000000..098cca6
--- /dev/null
+++ b/test/termios/Makefile
@@ -0,0 +1,8 @@
+# uClibc termios tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+top_builddir=../../
+top_srcdir=../../
+include ../Rules.mak
+-include Makefile.in
+include ../Test.mak
diff --git a/test/termios/termios.c b/test/termios/termios.c
new file mode 100644
index 0000000..5fbc344
--- /dev/null
+++ b/test/termios/termios.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
+#include <asm/ioctls.h>
+#include <sys/ioctl.h>
+
+int main(int argc,char *argv[])
+{
+ struct termios t;
+ int ret;
+
+ printf("TCGETS = 0x%08x\n",TCGETS);
+ printf("sizeof(struct termios) = %ld\n",(long)sizeof(struct termios));
+
+ ret = ioctl(fileno(stdout),TCGETS,&t);
+
+ if(ret<0){
+ perror("ioctl");
+ }else{
+ printf("ioctl returned %d\n",ret);
+ }
+
+ return 0;
+}