winsz comments

This commit is contained in:
Imbus 2025-11-03 03:06:58 +01:00
parent 319cfe0dbb
commit e1bd06eb69

View file

@ -5,6 +5,10 @@
int main(void) { int main(void) {
struct winsize w; struct winsize w;
/* See: man 2 ioctl */
/* See: man 2 TIOCGWINSZ */
/* See: linux/fs/ioctl.c */
/* See: linux/drivers/tty/tty_io.c (L: ~2709 and ~2359) */
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == -1) { if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == -1) {
perror("ioctl"); perror("ioctl");
return 1; return 1;