Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site genrad.UUCP Path: utzoo!linus!security!genrad!john From: john@genrad.UUCP (John Nelson) Newsgroups: net.news.b,net.unix-wizards Subject: Re: Does anyone have a vnews for 4.2bsd? Message-ID: <3798@genrad.UUCP> Date: Fri, 13-Jan-84 09:51:53 EST Article-I.D.: genrad.3798 Posted: Fri Jan 13 09:51:53 1984 Date-Received: Sat, 14-Jan-84 03:16:04 EST References: <435@axiom.UUCP> <827@cbosgd.UUCP> <1544@rlgvax.UUCP> Organization: GenRad, Bolton, Mass. Lines: 31 A "signal" system call is provided in the standard library for 4.2BSD (look in section 3C - compatibility library) The differences between this signal and the old signal are twofold: 1. The signal trapping routine is NOT reset to the default: each handler must do this explicitly if it is the desired action 2. When the signal handler routine is invoked, the signal MASK bit is set for that signal (see sigblock/sigsetmask). Additional signals of the same type that invoked the handler routine will be blocked until the handler returns (or longjmps, or explicitly resets the mask) Neither of these incompatibilities is insurmountable if you have the source code. In fact, in the programs I have been converting to 4.2, the most common problem is that of a SIGTSTP handler which resets the terminal parameters, and then kill's itself with SIGTSTP. The routine below fixes the problem: tstp_catcher() { /* I am called to catch tstp and fix the tty mode before stopping */ stty(1, &old_tty_parameters); signal(SIGTSTP, SIG_DFL); #ifdef BSD4_2 /* clear SIGTSTP mask bit */ sigsetmask(sigblock(0) & ~(1 << (SIGTSTP-1))); #endif kill(0, SIGTSTP); /* execution resumes here on a SIGCONT */ stty(1, &new_tty_parameters); }