diff --git a/kernel/pty.cpp b/kernel/pty.cpp index 4b137512..4a90b828 100644 --- a/kernel/pty.cpp +++ b/kernel/pty.cpp @@ -656,6 +656,7 @@ int PTY::master_ioctl(ioctx_t* ctx, int cmd, uintptr_t arg) const struct winsize* user_ws = (const struct winsize*) arg; if ( !ctx->copy_from_src(&ws, user_ws, sizeof(ws)) ) return -1; + winch(); return 0; } return ioctl(ctx, cmd, arg); diff --git a/kernel/tty.cpp b/kernel/tty.cpp index c31f34c8..1dc9214a 100644 --- a/kernel/tty.cpp +++ b/kernel/tty.cpp @@ -324,6 +324,17 @@ void TTY::hup() poll_channel.Signal(POLLHUP); } +void TTY::winch() // termlock taken +{ + ScopedLock family_lock(&process_family_lock); + if ( 0 < foreground_pgid ) + { + Process* process = CurrentProcess()->GetPTable()->Get(foreground_pgid); + if ( process ) + process->DeliverGroupSignal(SIGWINCH); + } +} + void TTY::ProcessUnicode(uint32_t unicode) { mbstate_t ps; diff --git a/kernel/tty.h b/kernel/tty.h index 930a8566..96f45e5f 100644 --- a/kernel/tty.h +++ b/kernel/tty.h @@ -78,6 +78,7 @@ public: public: void hup(); + void winch(); protected: void tty_output(const char* str)