Date: Wed, 9 Sep 1998 09:21:00 -0500 From: Jonathan Lemon <jlemon@americantv.com> To: Andrzej Bialecki <abial@nask.pl> Cc: freebsd-current@FreeBSD.ORG Subject: Re: Adding sysctl, part II Message-ID: <19980909092100.52274@right.PCS> In-Reply-To: <Pine.BSF.4.02A.9809091411140.21222-100000@korin.warman.org.pl>; from Andrzej Bialecki on Sep 09, 1998 at 02:54:22PM %2B0200 References: <1006.905339048@critter.freebsd.dk> <Pine.BSF.4.02A.9809091411140.21222-100000@korin.warman.org.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980909092100.52274>