From owner-freebsd-current Wed Sep 9 07:21:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA19107 for freebsd-current-outgoing; Wed, 9 Sep 1998 07:21:46 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sumatra.americantv.com (sumatra.americantv.com [207.170.17.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA19100 for ; Wed, 9 Sep 1998 07:21:43 -0700 (PDT) (envelope-from jlemon@americantv.com) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id JAA02249; Wed, 9 Sep 1998 09:21:31 -0500 (CDT) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id JAA27830; Wed, 9 Sep 1998 09:21:00 -0500 Message-ID: <19980909092100.52274@right.PCS> Date: Wed, 9 Sep 1998 09:21:00 -0500 From: Jonathan Lemon To: Andrzej Bialecki Cc: freebsd-current@FreeBSD.ORG Subject: Re: Adding sysctl, part II References: <1006.905339048@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: ; from Andrzej Bialecki on Sep 09, 1998 at 02:54:22PM +0200 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sep 09, 1998 at 02:54:22PM +0200, Andrzej Bialecki wrote: > > It's still unclear to me, however, what should I do to retrieve not only > the struct msgbuf (which the msgbufp points to), but the buffer itself as > well. If I understand this correctly, once I retrieved the struct msgbuf > contents, the msgbufp->msg_ptr is useless because it points to the data in > kernel space, so I need to make another call to retrieve the buffer > contents, right? The code in subr_prf.c can do this because it works in > kernel space all the time, but I can't... Well, if you get the address of the message buffer through msgbufp, you can then just open /dev/kmem and read the the buffer from that address. msgbufp points to an area of the allocated size, and the struct msgbuf is just the first thing in this area. This isn't exactly robust to changes, but will do what you want. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message