Bit tuning
[mirrors/Programs.git] / c / winsize.c
1 #include <stdio.h>
2 #include <sys/ioctl.h>
3
4 static int get_win_size (int fd, struct winsize *win)
5 {
6 int err = ioctl (fd, TIOCGWINSZ, (char *) win);
7 return err;
8 }
9
10 int main(void) {
11 struct winsize win;
12 if(!get_win_size(1, &win)) puts("Chyba!");
13 printf("%d %d :-)\n", win.ws_row, win.ws_col);
14 }
This page took 0.238359 seconds and 4 git commands to generate.