From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu ([128.61.1.1]) by archone.tamu.edu with SMTP id <45316>; Tue, 7 Apr 1992 16:18:20 -0500 Received: from burdell.cc.gatech.edu by gatech.edu (4.1/Gatech-9.1) id AA00670 for rc@archone.tamu.edu; Tue, 7 Apr 92 17:18:06 EDT Received: from terminus.cc.gatech.edu by burdell.cc.gatech.edu (4.1/SMI-4.1) id AA12799; Tue, 7 Apr 92 17:18:05 EDT Received: by terminus.cc.gatech.edu (4.1/SMI-4.1) id AA00942; Tue, 7 Apr 92 17:18:01 EDT From: arnold@cc.gatech.edu (Arnold Robbins) Message-Id: <9204072118.AA00942@terminus.cc.gatech.edu> Date: Tue, 7 Apr 1992 16:18:00 -0500 X-Ultrix: Just Say NO! X-Important-Saying: Premature Optimization Is The Root Of All Evil. X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: rc@archone.tamu.edu Subject: signal blocking? Is there an easy way to block a signal inside a signal handler? I'm using MGR from BellCore (fast!), and I've been trying to set up a signal handler for SIGWINCH so that the rows and columns in stty get reset whenever I resize a window. However, when you do an stty of the rows and columns, MGR kindly sends you another SIGWINCH too! So I need to temporarily block SIGWINCH (ignore it basically) inside my SIGWINCH handler. Here's what I ended up doing. Simple, but not terribly elegant. Note that the trailing sleep is needed or else the SIGWINCH comes in before we're ready. fn handle_winch { size=() { fn sigwinch # temporary stty -echo echo '4I' size=(`{gawk '{ printf "%d %d\n", $3/12, $4/20 ; exit }'}) stty echo stty columns $size(1) rows $size(2) sleep 1 fn sigwinch { handle_winch } } } fn sigwinch { handle_winch } -- Arnold Robbins --- College of Computing | Laundry increases Georgia Tech, Atlanta, GA 30332-0280 | exponentially in the Domain: arnold@cc.gatech.edu Phone: +1 404 894 9214 | number of children. UUCP: uunet!cc.gatech.edu!arnold FAX: +1 404 853 9378 | -- Miriam Robbins