From 4d5786544bb52c62fc1ae84d91684ef2268afa05 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 24 Aug 2020 12:29:30 -0400 Subject: add tcgetwinsize and tcsetwinsize functions, move struct winsize these have been adopted for future issue of POSIX as the outcome of Austin Group issue 1151, and are simply functions performing the roles of the historical ioctls. since struct winsize is being standardized along with them, its definition is moved to the appropriate header. there is some chance this will break source files that expect struct winsize to be defined by sys/ioctl.h without including termios.h. if this happens, further changes will be needed to have sys/ioctl.h expose it too. --- src/termios/tcgetwinsize.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/termios/tcgetwinsize.c (limited to 'src/termios/tcgetwinsize.c') diff --git a/src/termios/tcgetwinsize.c b/src/termios/tcgetwinsize.c new file mode 100644 index 00000000..9b3a65a4 --- /dev/null +++ b/src/termios/tcgetwinsize.c @@ -0,0 +1,8 @@ +#include +#include +#include "syscall.h" + +int tcgetwinsize(int fd, struct winsize *wsz) +{ + return syscall(SYS_ioctl, fd, TIOCGWINSZ, wsz); +} -- cgit v1.2.1