unix: add ioctl functions to get/set terminal window size on Linux

Add IoctlGetWinsize and IoctlSetWinsize to retreive and manipulate
Winsize structures on Linux, akin to the already existing implementation
on Solaris.

Also remove the named result parameter for IoctlSetInt and
IoctlSetTermios, as they add no additional use.

Change-Id: Id349d1d6a21d5c9a05943f4dcc3a275613ccf7b8
Reviewed-on: https://go-review.googlesource.com/49231
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tobias Klauser authored and Brad Fitzpatrick committed 2017-07-18 16:13:35 +00:00
1 parent 4cd6d1a821
commit cd2c276457
13 files changed
+92 -2

No files matched your search

+3
View File
@@ -28,6 +28,7 @@ package unix
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/inotify.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/param.h>
@@ -543,3 +544,5 @@ const _SC_PAGESIZE = C._SC_PAGESIZE
// Terminal handling
type Termios C.termios_t
type Winsize C.struct_winsize