Re: Devd event from GEOM?

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Tue, 25 Jan 2005 15:44:46 +0100
In message <20050125.073258.94555150.imp_at_bsdimp.com>, "M. Warner Losh" writes:

>: So suppose I'm listening to a devd socket to try and identify storage
>: devices arriving that I can automount.  How do I know which device
>: announcements are for storage devices?
>
>Hmmmm, once upon a time I'd have said 'stat the device, and you know'
>since those would be block devices....

We do actually have an ioctl, FIODTYPE, which will tell you the
"kind" of device, but that requires you to open it (O_NDELAY will
do)

>The trouble is that we don't
>know at that level either, yet when the GEOM even happens, how can we
>be sure that we win that race?

There is no way you can win the race.  The device may already be
gone again by the time you hear about the event.

Welcome to the world of dynamic hardware.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Tue Jan 25 2005 - 13:45:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC