2014-06-08 10:13:29 +04:00
|
|
|
/* This file is part of ToaruOS and is released under the terms
|
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2013 Kevin Lange
|
|
|
|
*/
|
2013-03-19 10:57:40 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
int main(int argc, char * argv) {
|
|
|
|
struct winsize w;
|
|
|
|
ioctl(0, TIOCGWINSZ, &w);
|
|
|
|
|
|
|
|
printf("This terminal has %d rows and %d columns.\n", w.ws_col, w.ws_row);
|
|
|
|
return 0;
|
|
|
|
}
|