Root/fbsize/files/fbsize.c

1#include <sys/ioctl.h>
2#include <string.h>
3#include <errno.h>
4#include <stdlib.h>
5#include <stdio.h>
6
7int
8main(int argc,char **argv)
9{
10struct winsize ws;
11
12if (ioctl(0,TIOCGWINSZ,&ws)!=0) {
13fprintf(stderr,"TIOCGWINSZ:%s\n",strerror(errno));
14exit(1);
15}
16printf("row=%d, col=%d, xpixel=%d, ypixel=%d\n",
17ws.ws_row,ws.ws_col,ws.ws_xpixel,ws.ws_ypixel);
18return 0;
19}
20

Archive Download this file



interactive