termios.c 406 B

123456789101112131415161718192021222324
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <termios.h>
  4. #include <unistd.h>
  5. #include <asm/ioctls.h>
  6. int main(int argc,char *argv[])
  7. {
  8. struct termios t;
  9. int ret;
  10. printf("TCGETS = 0x%08x\n",TCGETS);
  11. printf("sizeof(struct termios) = %d\n",sizeof(struct termios));
  12. ret = ioctl(fileno(stdout),TCGETS,&t);
  13. if(ret<0){
  14. perror("ioctl");
  15. }else{
  16. printf("ioctl returned %d\n",ret);
  17. }
  18. return 0;
  19. }