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 | |
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')
-rw-r--r-- | term/ChangeLog | 12 | ||||
-rw-r--r-- | term/devio.c | 1 | ||||
-rw-r--r-- | term/hurdio.c | 21 | ||||
-rw-r--r-- | term/ptyio.c | 1 | ||||
-rw-r--r-- | term/term.h | 5 | ||||
-rw-r--r-- | term/users.c | 3 |
6 files changed, 42 insertions, 1 deletions
diff --git a/term/ChangeLog b/term/ChangeLog index 3d8bf18f..94bda53c 100644 --- a/term/ChangeLog +++ b/term/ChangeLog @@ -1,3 +1,15 @@ +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. + 2002-06-13 Roland McGrath <roland@frob.com> * ptyio.c (pty_io_readable): int -> size_t in argument type. diff --git a/term/devio.c b/term/devio.c index 5a2e9904..77b1b240 100644 --- a/term/devio.c +++ b/term/devio.c @@ -762,6 +762,7 @@ const struct bottomhalf devio_bottom = { TERM_ON_MACHDEV, devio_init, + NULL, devio_start_output, devio_set_break, devio_clear_break, 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, diff --git a/term/ptyio.c b/term/ptyio.c index ee9db4a9..98fb5052 100644 --- a/term/ptyio.c +++ b/term/ptyio.c @@ -276,6 +276,7 @@ const struct bottomhalf ptyio_bottom = { TERM_ON_MASTERPTY, ptyio_init, + NULL, ptyio_start_output, ptyio_set_break, ptyio_clear_break, diff --git a/term/term.h b/term/term.h index c89e4425..db2be09c 100644 --- a/term/term.h +++ b/term/term.h @@ -135,11 +135,16 @@ uid_t term_group; mode_t term_mode; +/* XXX Including <sys/ioctl.h> or <hurd/ioctl_types.h> leads to "ECHO + undeclared" errors in munge.c or users.c. */ +struct winsize; + /* Functions a bottom half defines */ struct bottomhalf { enum term_bottom_type type; error_t (*init) (void); + error_t (*gwinsz) (struct winsize *size); error_t (*start_output) (void); error_t (*set_break) (void); error_t (*clear_break) (void); diff --git a/term/users.c b/term/users.c index ee27c855..a4e110b4 100644 --- a/term/users.c +++ b/term/users.c @@ -219,6 +219,9 @@ open_hook (struct trivfs_control *cntl, termstate = state; termflags |= TTY_OPEN; } + + if (bottom->gwinsz) + (*bottom->gwinsz) (&window_size); } mutex_unlock (&global_lock); |