From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 1 10:14:11 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE632106564A for ; Tue, 1 Apr 2008 10:14:11 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B35DF8FC18 for ; Tue, 1 Apr 2008 10:14:11 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 24809208C; Tue, 1 Apr 2008 12:14:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mel References: <200803301220.39921.fbsd.hackers@rachie.is-a-geek.net> <86ve33wo1e.fsf@ds4.des.no> <200803312145.39372.fbsd.hackers@rachie.is-a-geek.net> Date: Tue, 01 Apr 2008 12:14:08 +0200 In-Reply-To: <200803312145.39372.fbsd.hackers@rachie.is-a-geek.net> (Mel's message of "Mon\, 31 Mar 2008 21\:45\:38 +0200") Message-ID: <868wzx287j.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Popen and EVFILT_WRITE question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2008 10:14:12 -0000 Mel writes: > Dag-Erling Sm=C3=B8rgrav writes: > > it will either read input or it won't, and what happens when it > > reads depends entirely on what the fd it reads from is connected to, > > whether it's a slow or fast device, blocking or non-blocking, etc. > The kernel knows that the fd at the end of the pipe is blocked for > reading.=20 I'm not sure what you mean by that; do you mean that it's sleeping in read() or similar? What if it uses select(), poll() or kqueue() instead? > Does it also know it's the end of a pipe and what's on the other end? Cau= se=20 > it would be a cool filter to have, if you could detect a blocked child as= a=20 > parent. It sure is better then arbitrary timeouts (this code will run 'ma= ke=20 > install' as a daemon(3) and write 'yes' on those nasty post-install quest= ions=20 > in ports). Many ports will simply use the default configuration instead of asking if you build them with -DBATCH. Those that don't should be fixed, unless there is a very good reason (such as asking the user to accept a license before installing). You could also ask somebody in portmgr@ how the package-building cluster deals with this. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no