From: Ben Gras Date: Mon, 3 Oct 2005 12:03:57 +0000 (+0000) Subject: Add SIGWINCH signal and functionality in tty and support in PM. X-Git-Tag: v3.1.2a~675 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=8c4166ee85b175953b09e54fefa75f49cfaca5e2;p=minix.git Add SIGWINCH signal and functionality in tty and support in PM. --- diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index ea3cdb9a1..4034a0b93 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -646,7 +646,7 @@ message *m_ptr; /* pointer to message sent to task */ case TIOCSWINSZ: r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS, SELF, D, (vir_bytes) &tp->tty_winsize, (vir_bytes) size); - /* SIGWINCH... */ + sigchar(tp, SIGWINCH); break; #if ENABLE_SRCCOMPAT diff --git a/include/signal.h b/include/signal.h index f813ffb43..f88b27b37 100755 --- a/include/signal.h +++ b/include/signal.h @@ -25,8 +25,6 @@ typedef unsigned long sigset_t; #endif #endif -#define _NSIG 20 /* number of signals used */ - #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt (DEL) */ #define SIGQUIT 3 /* quit (ASCII FS) */ @@ -55,6 +53,11 @@ typedef unsigned long sigset_t; #define SIGKSIG 19 /* kernel signal pending */ #define SIGKSTOP 20 /* kernel shutting down */ +/* Regular signals. */ +#define SIGWINCH 21 /* window size has changed */ + +#define _NSIG 21 /* number of signals used */ + /* POSIX requires the following signals to be defined, even if they are * not supported. Here are the definitions, but they are not supported. */ diff --git a/servers/pm/main.c b/servers/pm/main.c index 04e98843b..66731e601 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -154,7 +154,7 @@ PRIVATE void pm_init() register struct boot_image *ip; static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 }; - static char ign_sigs[] = { SIGCHLD }; + static char ign_sigs[] = { SIGCHLD, SIGWINCH }; register struct mproc *rmp; register char *sig_ptr; phys_clicks total_clicks, minix_clicks, free_clicks; diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 621828b1f..b2bc1a649 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -244,15 +244,16 @@ sigset_t sig_map; /* Check each bit in turn to see if a signal is to be sent. Unlike * kill(), the kernel may collect several unrelated signals for a * process and pass them to PM in one blow. Thus loop on the bit - * map. For SIGINT and SIGQUIT, use proc_id 0 to indicate a broadcast - * to the recipient's process group. For SIGKILL, use proc_id -1 to - * indicate a systemwide broadcast. + * map. For SIGINT, SIGWINCH and SIGQUIT, use proc_id 0 to indicate + * a broadcast to the recipient's process group. For SIGKILL, use + * proc_id -1 to indicate a systemwide broadcast. */ for (i = 1; i <= _NSIG; i++) { if (!sigismember(&sig_map, i)) continue; switch (i) { case SIGINT: case SIGQUIT: + case SIGWINCH: id = 0; break; /* broadcast to process group */ case SIGKILL: id = -1; break; /* broadcast to all except INIT */