logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TIOCGWINSZ, TIOCSWINSZ - get and set window size

Description

Window sizes are kept in the kernel, but not used by the kernel (except in the case of virtual consoles, where the kernel will update the window size when the size of the virtual console changes, for example, by loading a new font). TIOCGWINSZ Get window size. TIOCSWINSZ Set window size. When the window size changes, a SIGWINCH signal is sent to the foreground process group.

Library

Standard C library (libc, -lc)

Name

TIOCGWINSZ, TIOCSWINSZ - get and set window size

Return Value

On success, 0 is returned. On error, -1 is returned, and errno is set to indicate the error.

See Also

ioctl(2), ioctl_tty(2const) Linux man-pages 6.9.1 2024-06-13 TIOCSWINSZ(2const)

Synopsis

#include<asm/termbits.h> /* Definition of TIOC*WINSZ constants */ #include<sys/ioctl.h>intioctl(intfd,TIOCGWINSZ,structwinsize*argp);intioctl(intfd,TIOCSWINSZ,conststructwinsize*argp);#include<asm/termios.h>structwinsize{unsignedshortws_row;unsignedshortws_col;unsignedshortws_xpixel; /* unused */ unsignedshortws_ypixel; /* unused */ };

See Also