diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-04-14 23:35:03 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-15 00:32:18 +0200 |
| commit | 29ff6d9fcc05b283b6d797146330e950286028ed (patch) | |
| tree | 66789441730e6b22149c953b254e7e753cee70a2 /tests | |
| parent | 4d276c640374c9981dad2681f98af8c8d133939a (diff) | |
syscalls: Add TIOCGWINSZ bindings.
* guix/build/syscalls.scm (TIOCGWINSZ): New macro.
(<window-size>): New record type.
(winsize): New C struct.
(winsize-struct): New variable.
(terminal-window-size, terminal-columns): New procedures.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/syscalls.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 8e24184fe2e..1b443be0c8b 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm | |||
| @@ -244,4 +244,17 @@ | |||
| 244 | (#f #f) | 244 | (#f #f) |
| 245 | (lo (interface-address lo))))))) | 245 | (lo (interface-address lo))))))) |
| 246 | 246 | ||
| 247 | (test-equal "terminal-window-size ENOTTY" | ||
| 248 | ENOTTY | ||
| 249 | (call-with-input-file "/dev/null" | ||
| 250 | (lambda (port) | ||
| 251 | (catch 'system-error | ||
| 252 | (lambda () | ||
| 253 | (terminal-window-size port)) | ||
| 254 | (lambda args | ||
| 255 | (system-error-errno args)))))) | ||
| 256 | |||
| 257 | (test-assert "terminal-columns" | ||
| 258 | (> (terminal-columns) 0)) | ||
| 259 | |||
| 247 | (test-end) | 260 | (test-end) |
