aboutsummaryrefslogtreecommitdiff
path: root/src/termios
diff options
context:
space:
mode:
Diffstat (limited to 'src/termios')
-rw-r--r--src/termios/tcgetwinsize.c8
-rw-r--r--src/termios/tcsetwinsize.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/termios/tcgetwinsize.c b/src/termios/tcgetwinsize.c
new file mode 100644
index 0000000..9b3a65a
--- /dev/null
+++ b/src/termios/tcgetwinsize.c
@@ -0,0 +1,8 @@
+#include <termios.h>
+#include <sys/ioctl.h>
+#include "syscall.h"
+
+int tcgetwinsize(int fd, struct winsize *wsz)
+{
+ return syscall(SYS_ioctl, fd, TIOCGWINSZ, wsz);
+}
diff --git a/src/termios/tcsetwinsize.c b/src/termios/tcsetwinsize.c
new file mode 100644
index 0000000..e01d0e2
--- /dev/null
+++ b/src/termios/tcsetwinsize.c
@@ -0,0 +1,8 @@
+#include <termios.h>
+#include <sys/ioctl.h>
+#include "syscall.h"
+
+int tcsetwinsize(int fd, const struct winsize *wsz)
+{
+ return syscall(SYS_ioctl, fd, TIOCSWINSZ, wsz);
+}