diff --git a/headers/posix/termios.h b/headers/posix/termios.h index bd98547a42..2f843111aa 100644 --- a/headers/posix/termios.h +++ b/headers/posix/termios.h @@ -234,6 +234,8 @@ extern int tcflow(int fd, int action); extern int tcflush(int fd, int queueSelector); extern pid_t tcgetsid(int fd); extern int tcsetsid(int fd, pid_t pid); +extern int tcgetwinsize(int fd, struct winsize* winsize); +extern int tcsetwinsize(int fd, const struct winsize* winsize); #ifdef __cplusplus } diff --git a/src/system/libroot/posix/termios.c b/src/system/libroot/posix/termios.c index 818157975a..ce0ebed5f4 100644 --- a/src/system/libroot/posix/termios.c +++ b/src/system/libroot/posix/termios.c @@ -194,3 +194,16 @@ tcsetsid(int fd, pid_t pid) return ioctl(fd, TIOCSCTTY, NULL); } + +int +tcgetwinsize(int fd, struct winsize* winsize) +{ + return ioctl(fd, TIOCGWINSZ, winsize, sizeof(*winsize)); +} + + +int +tcsetwinsize(int fd, const struct winsize* winsize) +{ + return ioctl(fd, TIOCSWINSZ, winsize, sizeof(*winsize)); +}