From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 31 17:55:54 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 20A3516A477 for ; Thu, 31 Jan 2008 17:55:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id C79A313C457 for ; Thu, 31 Jan 2008 17:53:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 230349759-1834499 for multiple; Thu, 31 Jan 2008 12:51:19 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m0VHqIAr021271; Thu, 31 Jan 2008 12:52:32 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Pietro Cerutti Date: Thu, 31 Jan 2008 11:53:02 -0500 User-Agent: KMail/1.9.7 References: <47A103A1.4030108@gahr.ch> <200801310553.59141.jhb@freebsd.org> <47A1E74A.3020003@gahr.ch> In-Reply-To: <47A1E74A.3020003@gahr.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801311153.02580.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 31 Jan 2008 12:52:32 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5628/Thu Jan 31 11:48:19 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: more on devstat (missing include) 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: Thu, 31 Jan 2008 17:55:54 -0000 On Thursday 31 January 2008 10:20:42 am Pietro Cerutti wrote: > John Baldwin wrote: > > On Wednesday 30 January 2008 06:09:21 pm Pietro Cerutti wrote: > >> Hi hackers, > >> > >> I think that i) sys/devicestat.h should include sys/resource.h or ii) > >> the man page of devstat(9) should mention that the user himself is > >> supposed to include sys/resource.h. > >> > >> Without: > >> > >>> cat devstat.c > >> #include > >> > >> int main(void) > >> { > >> devstat_getnumdevs(NULL); > >> return (0); > >> } > >>> gcc -ldevstat -o devstat devstat.c > >> In file included from devstat.c:1: > >> /usr/include/devstat.h:131: error: 'CPUSTATES' undeclared here (not in a > >> function) > >> Exit 1 > >> > >> > >> I can provide a patch if someone could tell me which one of the proposed > >> solutions above is the preferred one. > > > > I think this might be best: > > > > Index: devstat.h > > =================================================================== > > RCS file: /usr/cvs/src/lib/libdevstat/devstat.h,v > > retrieving revision 1.11 > > diff -u -r1.11 devstat.h > > --- devstat.h 22 Jul 2005 17:19:00 -0000 1.11 > > +++ devstat.h 31 Jan 2008 10:52:37 -0000 > > @@ -32,6 +32,7 @@ > > #define _DEVSTAT_H > > #include > > #include > > +#include > > > > #include > > > > > > Good. Are you committing that or I better send in a PR? I'll commit. -- John Baldwin