diff options
Diffstat (limited to 'test/termios')
-rw-r--r-- | test/termios/Makefile | 8 | ||||
-rw-r--r-- | test/termios/termios.c | 25 |
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; +} |