Date: Sun, 21 Jul 2019 14:58:53 +0000 (UTC) From: Laurie Jennings <laurie_jennings_1977@yahoo.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: mmap port from 9 not working Message-ID: <550659871.4389820.1563721133104@mail.yahoo.com> In-Reply-To: <20190721144404.GJ47193@kib.kiev.ua> References: <446145008.4396329.1563680883838.ref@mail.yahoo.com> <446145008.4396329.1563680883838@mail.yahoo.com> <20190721144404.GJ47193@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, July 21, 2019, 10:44:14 AM EDT, Konstantin Belousov <kostikbel@= gmail.com> wrote: On Sun, Jul 21, 2019 at 03:48:03AM +0000, Laurie Jennings wrote: > I have some custom stuff I'm porting from Freebsd 9.x using mmap. I get a= pointer from the kernel via an ioctl and I map it into a shared buffer. > char *kptr; =C2=A0 // mem ptr from kernel > fd=3Dopen("/dev/kmem",O_RDWR);memp=3Dmmap(0,size,PROT_READ|PROT_WRITE,MAP= _SHARED,fd,(off_t) ptr); >=C2=A0 > This worked perfectly in 9; memp I had a shared block of memory between t= he kernel and user space. > In 11.3 this returns an errno 22, which is pretty murky. I did notice tha= t off_t doesnt yield an actual offset; I've tried putting in the correct va= lue manuallybut it just fails and fails.I've tried read only also.=C2=A0 > Please Help! | Start with providing (and looking yourself) at the output of kdump/ktrace | around the failing mmap.=C2=A0 The checks for correctness of the mmap(2) = arguments | were greatly improved during years after FreeBSD 9. Since posting this I found a thread that said something about mmap no longe= r supporting /dev/kmem. If that's that case I need to find another method. = No sense spending a day debugging something thatisn't supposed to work.=C2= =A0 SHOULD this still work? This always worked fine with non-wired memory but m= aybe things have changed since 9.=C2=A0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?550659871.4389820.1563721133104>