Implement SIGWINCH.

This commit is contained in:
Jonas 'Sortie' Termansen 2024-06-17 13:29:59 +00:00
parent ecd5217da8
commit bf1d15957e
3 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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;

View File

@ -78,6 +78,7 @@ public:
public:
void hup();
void winch();
protected:
void tty_output(const char* str)