From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7383 invoked from network); 7 Jul 2009 21:17:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 7 Jul 2009 21:17:02 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 96813 invoked from network); 7 Jul 2009 21:09:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Jul 2009 21:09:37 -0000 Received: (qmail 23908 invoked by alias); 7 Jul 2009 21:09:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27095 Received: (qmail 23896 invoked from network); 7 Jul 2009 21:09:31 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 7 Jul 2009 21:09:31 -0000 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id CD42D8027106 for ; Tue, 7 Jul 2009 23:09:14 +0200 (CEST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MOHuY-0006pM-9C for zsh-workers@sunsite.dk; Tue, 07 Jul 2009 21:09:10 +0000 Received: from l3-128-170-36-102.l-3com.com ([128.170.36.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jul 2009 21:09:10 +0000 Received: from ebb9 by l3-128-170-36-102.l-3com.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jul 2009 21:09:10 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@sunsite.dk From: Eric Blake Subject: non-interactive set -m Date: Tue, 7 Jul 2009 21:08:57 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 128.170.36.102 (Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)) Sender: news X-Virus-Scanned: ClamAV 0.94.2/9541/Tue Jul 7 19:31:53 2009 on bifrost X-Virus-Status: Clean As far as I can tell, POSIX requires 'set -m' to work even in non-interactive shells, if the shell implements the User Portability Utilities (UP) option. POSIX is also explicit that 'set -b' shall default to disabled. Therefore, I claim that this demonstrates two bugs: $ zsh -c 'emulate sh; echo $-; set -m && set +m' b zsh:set:1: can't change option: -m $ echo 1 Of course, being a non-interactive environment, there are no prompts printed, so the rules about 'set -m' printing status changes prior to a prompt are ignored; and since 'set -b' should be disabled, no asynchronous status messages would be printed either. But the important part is that 'set -m' also controls the fact that background jobs are created in their own process group, which IS something that a non-interactive script can usefully exploit. Besides, POSIX is eplicit that jobs also work even when 'set +m' is in effect. Autoconf would LOVE to implement parallel testsuite support, but supporting clean signal-based testsuite abortion at the parent level without leaving hung children and without tickling fork bomb bugs in various ksh clones requires the use of job control in a non-interactive environment. Thus, at the moment, bash appears to be the only shell capable of reliably running a parallel testsuite: http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6776 -- Eric Blake