Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2001 10:36:22 +0930
From:      Greg Lehey <grog@lemis.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Mike Smith <msmith@FreeBSD.org>, freebsd-alpha@FreeBSD.org, leclercn@videotron.ca
Subject:   Re: dev_t size mismatch kernel / userland
Message-ID:  <20010326103622.H40349@wantadilla.lemis.com>
In-Reply-To: <XFMail.010323214512.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Fri, Mar 23, 2001 at 09:45:12PM -0800
References:  <200103240509.f2O59L900618@mass.dis.org> <XFMail.010323214512.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 23 March 2001 at 21:45:12 -0800, John Baldwin wrote:
>
> On 24-Mar-01 Mike Smith wrote:
>>>   Already tried vinum, works fine after modification of dev_t to
>>> u_int64_t.  I'll change it to uintptr_t tough (cleaner).  Hope this gets
>>> fixed!
>>
>> This is wrong.  In the kernel or in a module, dev_t is an opaque type.
>> In userspace, you use udev_t, not dev_t.
>>
>> It sounds like vinum is failing to perform the required conversions when
>> exchanging a dev_t with userland, and the correct fix is going to be to
>> add these.
>
> struct drive, struct plex, etc. are shared between userland and the kernel.  It
> looks like they need to use a udev_t, and the kernel will always have to do
> udev2dev() before using them.  Either that or don't export the structures to
> userland.

I already had code under way to export expurgated versions of these
structs.  But that's a separate issue.  It seems to me that if dev_t
is even visible in userland header files, it should be correct.  We
should either fix it or remove it.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010326103622.H40349>