From owner-freebsd-stable@FreeBSD.ORG Sun Sep 18 11:54:39 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804CC106564A; Sun, 18 Sep 2011 11:54:39 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A48F58FC19; Sun, 18 Sep 2011 11:54:38 +0000 (UTC) Received: by fxg9 with SMTP id 9so4142555fxg.13 for ; Sun, 18 Sep 2011 04:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Y6nUMBkEJb9WcmDwXEFSDQl1UVnBCbmZP7Q7gS7nijo=; b=uGwdaV6Y56sgOJk6KehwT0vi30mUTI7+yaniHRgTfrx6sZoxKA+ElKysbb5pTiqEYa 2ra+u+e+UTcE7jt8/YmfOlTTagjvq90Er06rOnxbWWjhqNqNbj41mUMWhyUMvkhi/miQ V+TJOEpRc761zBnc2mDhRDLZ3OlZJ1d9IsIJ0= Received: by 10.223.48.211 with SMTP id s19mr3029228faf.33.1316346877696; Sun, 18 Sep 2011 04:54:37 -0700 (PDT) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id o16sm17974800fag.21.2011.09.18.04.54.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Sep 2011 04:54:36 -0700 (PDT) From: Mikolaj Golub To: "Ronald Klop" References: <20110918045413.GA63773@DataIX.net> <20110918053901.GA31617@icarus.home.lan> <86d3eydsmf.fsf@kopusha.home.net> X-Comment-To: Ronald Klop Sender: Mikolaj Golub Date: Sun, 18 Sep 2011 14:54:34 +0300 In-Reply-To: (Ronald Klop's message of "Sun, 18 Sep 2011 13:25:26 +0200") Message-ID: <868vpmdq11.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "freebsd-stable@freebsd.org" , Jeremy Chadwick , cperciva@freebsd.org Subject: Re: /usr/bin/script eating 100% cpu with portupgrade and xargs X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2011 11:54:39 -0000 On Sun, 18 Sep 2011 13:25:26 +0200 Ronald Klop wrote: RK> It is a while since I programmed C, but why will writing 0 bytes give RK> the reader an end-of-file? Shouldn't the fd be closed to indicate RK> end-of-file? AFAIR, this trick with writing 0 to emulate EOF because we can't close the fd -- we still want to read from it. Poor shutdown(2) for non-socket :-). Colin might tell more... -- Mikolaj Golub