Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <termios.h>
  4.  
  5. int main()
  6. {
  7. struct winsize sz;
  8.  
  9. printf("isatty 0=%d\n", isatty(0));
  10. if (ioctl(0,TIOCGWINSZ, &sz) == 0) {
  11. printf("ioctl succeeded. sz.ws_row=%d\n", sz.ws_row);
  12. }
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement