From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: Support for (system '("echo" "foo" "bar")) Date: Fri, 31 Oct 2003 17:10:22 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87ad7l9i8h.fsf@raven.i.defaultvalue.org> <87u15qpjwk.fsf@zip.com.au> <877k2mgdjs.fsf@raven.i.defaultvalue.org> <87d6cde1tr.fsf@raven.i.defaultvalue.org> <87oevxb1uy.fsf@zip.com.au> <87znfh9l6v.fsf@zip.com.au> <87vfq59iyf.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1067638599 20080 80.91.224.253 (31 Oct 2003 22:16:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2003 22:16:39 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 31 23:16:36 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFhZM-00045C-00 for ; Fri, 31 Oct 2003 23:16:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFhZB-0003d1-CY for guile-devel@m.gmane.org; Fri, 31 Oct 2003 17:16:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFhTy-0001xy-4Z for guile-devel@gnu.org; Fri, 31 Oct 2003 17:11:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFhTN-0001n9-0O for guile-devel@gnu.org; Fri, 31 Oct 2003 17:10:56 -0500 Original-Received: from [129.22.104.63] (helo=harris.CNS.CWRU.Edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFhTM-0001mu-If for guile-devel@gnu.org; Fri, 31 Oct 2003 17:10:24 -0500 Original-Received: from conversion-daemon.smtp-a.cwru.edu by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) id <0HNN004016ULIK@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 17:10:23 -0500 (EST) Original-Received: from multivac.cwru.edu (multivac.ITS.CWRU.Edu [129.22.114.26]) by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HNN00M0C6XBTQ@smtp-a.cwru.edu> for guile-devel@gnu.org; Fri, 31 Oct 2003 17:10:23 -0500 (EST) Original-Received: (qmail 22246 invoked by uid 500); Fri, 31 Oct 2003 22:10:45 +0000 In-reply-to: <87vfq59iyf.fsf@zip.com.au> Original-To: guile-devel@gnu.org Mail-followup-to: guile-devel@gnu.org Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Original-Lines: 40 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2951 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2951 Kevin Ryde wrote: > prj@po.cwru.edu (Paul Jarc) writes: >> Is it possible to guarantee that the child will not trigger garbage >> collection? > > Probably not. A good reason to do it in C. Even in C, avoiding garbage collection is probably impossible. At some level, the child has to allocate the argv array that will be passed to execve(). > (Though it could be argued that it ought to be possible to this sort > of thing safely at the scheme level, somehow.) I think my Scheme procedure is safe. > Incidentally, looking at glibc sysdeps/posix/system.c, it seems to > ignore SIGINT and SIGQUIT in the parent while running the child. I'm > not up with the standards or conventions on this, but for maximum > compatibility I suppose a "system*" might like to do the same. I believe that's geared toward applications running on a tty, with the assumption that if the user interrupts the child, the parent is supposed to keep running. This may or may not be what an application wants, so we should provide both varieties. Given system*/nowait as before, we can have (with whatever names): (define (system*/no-ignore-signals . args) (cdr (waitpid (apply system*/nowait args)))) (define (system*/ignore-signals . args) (let* ((pid (apply system*/nowait args)) (old-int (sigaction SIGINT SIG_IGN)) (old-quit (sigaction SIGQUIT SIG_IGN)) (status (cdr (waitpid (apply system*/nowait args))))) (sigaction SIGINT (car old-int) (cdr old-int)) (sigaction SIGQUIT (car old-quit) (cdr old-quit)) status)) paul _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel