GetTIOCGWINSZ.c 387 B

123456789101112
  1. #include <stdio.h>
  2. #include <sys/ioctl.h>
  3. // Used to get the value of the TIOCGWINSZ variable,
  4. // which may have different values ​​on different Unix operating systems.
  5. // Linux=0x005413
  6. // Darwin and OpenBSD=0x40087468,
  7. // Solaris=0x005468
  8. // See https://stackoverflow.com/questions/16237137/what-is-termios-tiocgwinsz
  9. int get_tiocgwinsz_value() {
  10. return TIOCGWINSZ;
  11. }