diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-06-25 15:46:29 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-06-25 15:46:29 +0000 |
commit | 8856517683eeb5bf6f213b6322e429d54fa2db76 (patch) | |
tree | 630330fa85431dcc36c0b56feacb11ce8b4f8784 /term/hurdio.c | |
parent | 536cecf4f43ba2474d6bf576eb787ceb8a731e48 (diff) |
2002-06-25 Marcus Brinkmann <marcus@gnu.org>
* term.h (struct bottomhalf): New member GWINSZ.
* devio.c (devio_bottom): Add new member.
* ptyio.c (ptyio_bottom): Likewise.
* hurdio.c (hurdio_bottom): Likewise.
(hurdio_gwinsz): New function.
(tioc_caps): Change type to unsigned int.
(TIOC_CAP_GWINSZ): New symbol.
* users.c (open_hook): Call GWINSZ of bottom layer after
establishing the carrier.
Diffstat (limited to 'term/hurdio.c')
-rw-r--r-- | term/hurdio.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/term/hurdio.c b/term/hurdio.c index 9ba2d60c..b9afa33d 100644 --- a/term/hurdio.c +++ b/term/hurdio.c @@ -59,7 +59,8 @@ static file_t ioport = MACH_PORT_NULL; #define TIOC_CAP_MODS 0x080 #define TIOC_CAP_GETA 0x100 #define TIOC_CAP_SETA 0x200 -int tioc_caps; +#define TIOC_CAP_GWINSZ 0x400 +unsigned int tioc_caps; /* The thread performing all writes. Only different from MACH_PORT_NULL if thread is live and blocked. */ @@ -98,6 +99,23 @@ hurdio_init (void) } +static error_t +hurdio_gwinsz (struct winsize *size) +{ + if (tioc_caps & TIOC_CAP_GWINSZ) + { + error_t err = tioctl_tiocgwinsz (ioport, size); + if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP)) + { + tioc_caps &= ~TIOC_CAP_GWINSZ; + err = EOPNOTSUPP; + } + return err; + } + return EOPNOTSUPP; +} + + /* Assert the DTR if necessary. Must be called with global lock held. */ static void wait_for_dtr (void) @@ -579,6 +597,7 @@ const struct bottomhalf hurdio_bottom = { TERM_ON_HURDIO, hurdio_init, + hurdio_gwinsz, hurdio_start_output, hurdio_set_break, hurdio_clear_break, |