Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!cuae2!ltuxa!we53!sw013b!dj3b1!killer!jfh From: jfh@killer.UUCP Newsgroups: comp.unix.questions Subject: Re: Shell doesn't pass modified signal mask to sub-processes Message-ID: <763@killer.UUCP> Date: Thu, 9-Apr-87 16:56:12 EST Article-I.D.: killer.763 Posted: Thu Apr 9 16:56:12 1987 Date-Received: Sun, 12-Apr-87 01:27:08 EST References: <319@baskin.UUCP> Organization: The Unix(tm) Connection, Dallas, Texas Lines: 53 Keywords: No need to read article - Summary gives it all ... Summary: Try writing your own system(3) call. I ran into this once. In K&R or the old Green Unix book someone gives the code to system(3). Scarf this code and modify it to handle the signals the way you want. Or, chew on this ... --------------- cut here at your own risk ---------------- #include system (s) char *s; { int child; int status; int i; int (*ifunc) ()); int (*qfunc) ()); child = fork (); if (child < 0) return (-1); if (child > 0) { ifunc = signal (SIG_INT, SIG_IGN); qfunc = signal (SIG_QUIT, SIG_IGN); while (wait (&status) != child) ; signal (SIG_INT, ifunc); signal (SIG_QUIT, qfunc); return (status); } else { signal (SIG_INT, SIG_DFL); signal (SIG_QUIT, SIG_DFL); execle ("/bin/sh", "-c", s, (char *) 0); exit (0377); } } -------------------------- slash ----------------------- Okay? - John. Disclaimer: You are responsible for your own actions. Including believing that this code works ...