Add SIGWINCH signal and functionality in tty and support in PM.

This commit is contained in:
Ben Gras 2005-10-03 12:03:57 +00:00
parent f1d9413da7
commit 8c4166ee85
4 changed files with 11 additions and 7 deletions

View File

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

View File

@ -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.
*/

View File

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

View File

@ -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 */