From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 26 05:45:25 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACA9A16A4CE for ; Thu, 26 Feb 2004 05:45:25 -0800 (PST) Received: from pinus.cc.fer.hr (pinus.cc.fer.hr [161.53.73.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id E66A743D31 for ; Thu, 26 Feb 2004 05:45:24 -0800 (PST) (envelope-from ivoras@fer.hr) Received: from fer.hr (lara.cc.fer.hr [161.53.72.113]) by pinus.cc.fer.hr (8.12.2/8.12.2) with ESMTP id i1QDjNdm002563 for ; Thu, 26 Feb 2004 14:45:23 +0100 (MET) Message-ID: <403DF7BA.1060407@fer.hr> Date: Thu, 26 Feb 2004 14:42:18 +0100 From: Ivan Voras User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org References: <403DF050.80208@fer.hr> <20040226133159.GA17994@saboteur.dek.spc.org> In-Reply-To: <20040226133159.GA17994@saboteur.dek.spc.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Accessing sysctls from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 13:45:25 -0000 Bruce M Simpson wrote: > On Thu, Feb 26, 2004 at 02:10:40PM +0100, Ivan Voras wrote: > >>In sys/sys/sysctl.h I see function kernel_sysctlbyname() that looks (to >>me) to be intended for accessing sysctl values from kernel, but for it's >>first parameter it requires a struct thread *td. > > You could try lying about which thread you are, when you aren't in > a userland thread: Ok, that seems reasonable - I'll try using thread0.