From owner-freebsd-current Tue Oct 8 11:25:34 2002 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 6B76437B401 for ; Tue, 8 Oct 2002 11:25:33 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33F3443E6A for ; Tue, 8 Oct 2002 11:25:33 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 1376AAE2D6; Tue, 8 Oct 2002 11:25:33 -0700 (PDT) Date: Tue, 8 Oct 2002 11:25:33 -0700 From: Maxime Henrion To: "Vladimir B. Grebenschikov" Cc: freebsd-current@freebsd.org Subject: Re: DDB sysctl function Message-ID: <20021008182532.GM57622@elvis.mu.org> References: <1034097697.1548.2.camel@vbook.express.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1034097697.1548.2.camel@vbook.express.ru> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Vladimir B. Grebenschikov wrote: > Hi > > Attached diff introduces new ddb interface - access to sysctl interface [...] Looks like this would be very useful. I have a few comments, mainly about style though. - There is a TOK_STRING_SIZE macro which defines the size of the the db_tok_string variable. Use it instead of declaring several 1k variables on the stack. - I'm not sure if using the context of the init process to do sysctl calls is the right way to go. However, it is not very clear what you should use to do this, at least to me. - You remove the "static" keyword for the db_examine() function to make it available in your code; that's OK, but you should then put the prototype in some header and not duplicate it in your code. - Don't use the __P() macro, it is deprecated now and shouldn't be added in new code. - Use the /usr/share/examples/etc/bsd-style-copyright file to put a proper copyright in your new files. There is room for your name and the date there. - Wrap lines at 80 characters. :-) Cheers, Maxime To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message