From owner-freebsd-hackers@FreeBSD.ORG Thu May 6 18:00:06 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 876BB1065675 for ; Thu, 6 May 2010 18:00:06 +0000 (UTC) (envelope-from czerner.lukas@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 09A6B8FC1B for ; Thu, 6 May 2010 18:00:05 +0000 (UTC) Received: by fxm15 with SMTP id 15so215386fxm.13 for ; Thu, 06 May 2010 10:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=nv89blVxfIT704yu2McWOq2+OgtaR+cPbdWDvSr/3Z4=; b=YjwJHNYc9Pc4cvsDLf5MMH2SBWC7FwFxAcjtaoJdowW5DPwYm+EkgDWsIRxXUHdXJs lTRSMNWYBqIXCk6IeReLphJvPAErgf4Ap1+s5qKztDYzutzWxk1j8N0K9NrfmBToHPAt CRmYHqD6wtGJIosmXMbX0lm1OYbxggjXUHVJI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=ZDgoknoWZSsolGLJfHshtTit7bUbEumfkAKqEpjZJcCNBW3Un/VnkxwYs8de0nJ2KB 9JHJQqYXLXJFln0/apqb+1W9TYfC8XDm96RrSh2Ri9aU4P3LqgWLPqiQxjsjQMbZwGCb SoQ2r4/MXUezCaDQ/DkJ7icgp1JrvIyTKI53w= Received: by 10.87.47.6 with SMTP id z6mr2148755fgj.13.1273168799446; Thu, 06 May 2010 10:59:59 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id 4sm3524642fgg.2.2010.05.06.10.59.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 May 2010 10:59:58 -0700 (PDT) Date: Thu, 6 May 2010 19:59:56 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: Julian Elischer In-Reply-To: <4BE2F13C.4010708@elischer.org> Message-ID: References: <4BE2F13C.4010708@elischer.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-695050703-1273168798=:21095" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= 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 18:00:06 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-695050703-1273168798=:21095 Content-Type: TEXT/PLAIN; charset=windows-1252 Content-Transfer-Encoding: 8BIT On Thu, 6 May 2010, Julian Elischer wrote: > Date: Thu, 06 May 2010 09:41:32 -0700 > From: Julian Elischer > To: Lukáš Czerner > Cc: freebsd-hackers@freebsd.org > Subject: Re: How to get data from kernel module ? > > On 5/6/10 6:38 AM, Lukáš Czerner wrote: > > Hi, > > > > 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 > > 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? > > > > 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. > > > > you can add a sysctl to pass out arbitrary information very easily. > It's up to you to decide where you want to put it in the sysctl > tree. > Thank to you all for suggestions. I will look at the sysctl then. Thanks! -Lukas --8323329-695050703-1273168798=:21095--