Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 21:45:12 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mike Smith <msmith@FreeBSD.org>
Cc:        freebsd-alpha@FreeBSD.org, grog@FreeBSD.org, leclercn@videotron.ca
Subject:   Re: dev_t size mismatch kernel / userland
Message-ID:  <XFMail.010323214512.jhb@FreeBSD.org>
In-Reply-To: <200103240509.f2O59L900618@mass.dis.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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?XFMail.010323214512.jhb>