From owner-freebsd-hackers@FreeBSD.ORG Thu May 6 14:10:23 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FBD31065674 for ; Thu, 6 May 2010 14:10:23 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id D152F8FC0A for ; Thu, 6 May 2010 14:10:22 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:60573 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1OA1jo-0001Zv-71 for freebsd-hackers@freebsd.org; Thu, 06 May 2010 16:07:43 +0200 Received: (qmail 45206 invoked by uid 1001); 6 May 2010 16:07:36 +0200 Date: Thu, 6 May 2010 16:07:36 +0200 From: Erik Trulsson To: =?iso-8859-1?B?THVr4ag=?= Czerner Message-ID: <20100506140736.GA45117@falcon.midgard.homeip.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1OA1jo-0001Zv-71. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1OA1jo-0001Zv-71 75d63da2ed83526d9cee926f455d0349 Cc: freebsd-hackers@freebsd.org Subject: Re: How to get data from kernel module ? 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, 06 May 2010 14:10:23 -0000 On Thu, May 06, 2010 at 03:38:30PM +0200, Luk=E1=A8 Czerner wrote: > Hi, >=20 > I am creating a kernel module and I need to get some information from > that module. I can do this with ioctl and pass the data to the > user space but it seems a bit unpractical to me, because I do not know=20 > the amount of the data - it can differ. I do not know of any way to > pass a list of structures to the userspace through ioctl - is there > any? >=20 > So my question is, is there any standard way in FreeBSD to do this ? > In linux I would probably use the sysfs, but in FreeBSD I can not find > anything similar, except just creating some virtual filesystem on my > own and obviously this is not what I want to do. sysctl(3) seems to be the usual way of getting information from the kernel. --=20 Erik Trulsson ertr1013@student.uu.se