From owner-freebsd-current@FreeBSD.ORG Thu May 19 10:42:14 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2505016A4CE; Thu, 19 May 2005 10:42:14 +0000 (GMT) Received: from mail.hamnpolare.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C5BF43D81; Thu, 19 May 2005 10:42:11 +0000 (GMT) (envelope-from fli+freebsd-current@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mail.hamnpolare.net (Postfix) with ESMTP id CA53A1A6F0; Thu, 19 May 2005 12:42:08 +0200 (CEST) Received: from mail.hamnpolare.net ([127.0.0.1])port 10024) with ESMTP id 30417-09; Thu, 19 May 2005 12:42:07 +0200 (CEST) Received: from biocandy.shapeshifter.se (h99n2fls32o270.telia.com [217.210.25.99]) by mail.hamnpolare.net (Postfix) with ESMTP id C78FB1A6D5; Thu, 19 May 2005 12:42:07 +0200 (CEST) Received: by biocandy.shapeshifter.se (Postfix, from userid 1001) id 9E5BB428A; Thu, 19 May 2005 12:42:07 +0200 (CEST) Date: Thu, 19 May 2005 12:42:07 +0200 From: Fredrik Lindberg To: Nate Lawson Message-ID: <20050519104207.GA1259@shapeshifter.se> References: <428C1EA6.7020907@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <428C1EA6.7020907@root.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: at example.com cc: Warner Losh cc: current@FreeBSD.org Subject: Re: Patch to make powerd(8) devd(8)-aware X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 10:42:14 -0000 On Wed, May 18, 2005 at 10:05:42PM -0700, Nate Lawson (nate@root.org) wrote: > I appreciate you working on a patch for this. However, I'd prefer the > work on the devd side go into making devctl a clonable device or follow > the bpf route and hook up /dev/devctl0,1,2,... If you start using the > /var/run/devd.pipe, it's not available for other consumers. > Yes, devctl should probably be able to have more readers, I won't argue with that. However, devd allows any number of consumers to the devd.pipe. I've had upto 4 programs reading devd.pipe simultaneously and they all got the same data. > I agree that the sysctl errors should be soft at runtime although you > should make sure that powerd(8) does not spin in a fast loop if sysctl > returns an error (i.e. the sleep at the bottom should be called even > when there's an error). The usleep call is at the top of the loop so this shouldn't be an issue. > > Other comments: > style(9) long sscanf line I'm familiar with style(9), however I don't recall anything about sscanf, could you please explain the correct behaviour in this case (except trying to reducing indent) > extra newlines inserted into existing code > change read() in devd_read() to return on error instead of running > sscanf -- this will allow the indent to be reduced. My mistakes, sorry. Fredrik Lindberg