From owner-freebsd-current Tue Oct 8 14:33:57 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 177A237B401 for ; Tue, 8 Oct 2002 14:33:56 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ED3343E6E for ; Tue, 8 Oct 2002 14:33:55 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 16834 invoked from network); 8 Oct 2002 21:33:56 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 8 Oct 2002 21:33:56 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g98LXrn5007406; Tue, 8 Oct 2002 17:33:53 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <1034110999.1146.3.camel@vbook.express.ru> Date: Tue, 08 Oct 2002 17:33:57 -0400 (EDT) From: John Baldwin To: "Vladimir B. "@FreeBSD.ORG, Grebenschikov@FreeBSD.ORG, " "@server.baldwin.cx Subject: Re: DDB sysctl function Cc: freebsd-current@freebsd.org, Maxime Henrion 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 On 08-Oct-2002 Vladimir B. " Grebenschikov wrote: > χ Tue, 08.10.2002, Χ 22:25, Maxime Henrion ΞΑΠΙΣΑΜ: >> 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. > > Attached fixed patch > >> - 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. > > It is not token buffers - it is buffers for sysctl data interchange, > const 1024 changed to SYSCTL_DATA_BUFSIZE define. > >> - 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. > > kernel_sysctl need thread pointer, it may be used in sysctl handlers. Use curthread perhaps. In -current you always have a thread context, even when idle. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message