From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 31 15:20:46 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 53FEC16A418; Thu, 31 Jan 2008 15:20:46 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id 05C3C13C459; Thu, 31 Jan 2008 15:20:45 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from town.bfh.ch ([147.87.98.171]) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1JKbDY-00017p-1T; Thu, 31 Jan 2008 16:20:44 +0100 Message-ID: <47A1E74A.3020003@gahr.ch> Date: Thu, 31 Jan 2008 16:20:42 +0100 From: Pietro Cerutti User-Agent: Thunderbird 1.5.0.9 (X11/20070104) MIME-Version: 1.0 To: John Baldwin References: <47A103A1.4030108@gahr.ch> <200801310553.59141.jhb@freebsd.org> In-Reply-To: <200801310553.59141.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: 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 15:20:46 -0000 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? -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp