Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!ut-sally!ut-ngp!infotel!pollux!bobkat!m5d From: m5d@bobkat.UUCP Newsgroups: comp.unix.questions Subject: Re: Shell doesn't pass modified signal mask to sub-processes Message-ID: <853@bobkat.UUCP> Date: Thu, 9-Apr-87 09:37:08 EST Article-I.D.: bobkat.853 Posted: Thu Apr 9 09:37:08 1987 Date-Received: Sun, 12-Apr-87 03:27:39 EST References: <319@baskin.UUCP> Reply-To: m5d@bobkat.UUCP (Mike McNally (Man Insane)) Organization: Digital Lynx, Inc; Dallas, TX Lines: 37 Keywords: ...and I want it to! Is there a work-around? In article <319@baskin.UUCP> wmk@baskin.UUCP (Bill Kules) writes: >I've "discovered," much to my dismay, that the Bourne shell does >not let me pass the modified signal mask to the sub-processes it >spawns; it only passes the original one. (We have a Gould 6040 >running UTX/32 1.2, a BSD 4.2 system with a little Sys V.) > >The situation is: I run a C program that sets the signal mask >to ignore interrupt and quit signals. It then calls a /bin/sh >script. Within that script I reset the mask (i.e., trap 2 3) >and then call another C program. The mask being passed to that >program still ignores SIGINT and SIGQUIT. > >Thanks in advance, >-- >Bill Kules "We're on the road >...seismo!vrdxhq!baskin!wmk and we're gunning for the Buddha" >...decuac!baskin!wmk -- Shriekback There is a difference between the signal mask and the mechanism by which signals are ignored. The call signal(SIGBLAH, SIG_IGN); does nothing at all to the signal mask. The mask is set with sigblock() or sigsetmask() (or sort of with sigvec()). Notice also that the man page for sh says that "trap" with a missing command resets the signals to their original value -- that is, the value the shell found upon entry. This value is of course SIG_IGN, since the parent C program set that. Why not try removing the "trap" statement from the script? -- Mike McNally, mercifully employed at Digital Lynx --- Where Plano Road the Mighty Flood of Forest Lane doth meet, And Garland fair, whose perfumed air flows soft about my feet... uucp: {texsun,killer,infotel}!pollux!bobkat!m5d (214) 238-7474