From owner-freebsd-questions@FreeBSD.ORG Tue Apr 29 19:51:05 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 096C757F for ; Tue, 29 Apr 2014 19:51:05 +0000 (UTC) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD9E1306 for ; Tue, 29 Apr 2014 19:51:04 +0000 (UTC) Received: from [82.113.99.229] (helo=tiny-r255948) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1WfCzm-0001xt-GU for freebsd-questions@freebsd.org; Tue, 29 Apr 2014 20:43:11 +0200 Received: from tiny-r255948 (localhost [127.0.0.1]) by tiny-r255948 (8.14.7/8.14.3) with ESMTP id s3TIh9K5001208 for ; Tue, 29 Apr 2014 20:43:09 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by tiny-r255948 (8.14.7/8.14.3/Submit) id s3TIh8vK001207 for freebsd-questions@freebsd.org; Tue, 29 Apr 2014 20:43:08 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: tiny-r255948: guru set sender to guru@unixarea.de using -f Date: Tue, 29 Apr 2014 20:43:08 +0200 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: system(3) && open file descriptors Message-ID: <20140429184307.GA1114@tiny-r255948> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 10.0-CURRENT r235646 (i386) User-Agent: Mutt/1.5.21 (2010-09-15) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 82.113.99.229 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 19:51:05 -0000 Hi, It seems that the proc started by the C library call system(3), as /bin/sh -c string owns the same set of open file descriptors as its calling proc. Is this somewhere documented as a feature? 'man system" does not say anything about, while 'man fork' does. Thx matthias -- Sent from my FreeBSD netbook Matthias Apitz, , http://www.unixarea.de/ f: +49-170-4527211 UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5