summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-10-11 00:02:11 +0200
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-10-11 00:02:11 +0200
commit8a9a47179332700c5c270dafc6ef014417015f99 (patch)
tree578673e74a100d051a2d0c95c517d27b6fa3e516 /console.c
parent7b0347285ecb0b78ce0b699a1a6c9e50e22f7f07 (diff)
downloadMAC-Telnet-8a9a47179332700c5c270dafc6ef014417015f99.tar.gz
MAC-Telnet-8a9a47179332700c5c270dafc6ef014417015f99.zip
First version of mac-telnet server daemon mactelnetd. Use with care until it has been tested enough. Not for production use. To be cleaned up a lot.
Diffstat (limited to 'console.c')
-rw-r--r--console.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/console.c b/console.c
index 786d63c..090e11c 100644
--- a/console.c
+++ b/console.c
@@ -70,3 +70,18 @@ int getTerminalSize(unsigned short *width, unsigned short *height) {
return 0;
}
+
+int setTerminalSize(int fd, unsigned short width, unsigned short height) {
+ struct winsize ws;
+
+ ws.ws_col = width;
+ ws.ws_row = height;
+
+ if (ioctl(fd, TIOCSWINSZ, &ws) != 0) {
+ perror("TIOCSWINSZ");
+ return -1;
+ }
+
+ return 0;
+}
+