lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | ||||
3 | #include <termios.h> | ||||
4 | #include <unistd.h> | ||||
5 | #include <asm/ioctls.h> | ||||
6 | #include <sys/ioctl.h> | ||||
7 | |||||
8 | int main(int argc,char *argv[]) | ||||
9 | { | ||||
10 | struct termios t; | ||||
11 | int ret; | ||||
12 | |||||
13 | printf("TCGETS = 0x%08x\n",TCGETS); | ||||
14 | printf("sizeof(struct termios) = %ld\n",(long)sizeof(struct termios)); | ||||
15 | |||||
16 | ret = ioctl(fileno(stdout),TCGETS,&t); | ||||
17 | |||||
18 | if(ret<0){ | ||||
19 | perror("ioctl"); | ||||
20 | }else{ | ||||
21 | printf("ioctl returned %d\n",ret); | ||||
22 | } | ||||
23 | |||||
24 | return 0; | ||||
25 | } |