diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-10-11 00:02:11 +0200 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2010-10-11 00:02:11 +0200 |
commit | 8a9a47179332700c5c270dafc6ef014417015f99 (patch) | |
tree | 578673e74a100d051a2d0c95c517d27b6fa3e516 /console.c | |
parent | 7b0347285ecb0b78ce0b699a1a6c9e50e22f7f07 (diff) | |
download | MAC-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.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; +} + |