From owner-freebsd-current@FreeBSD.ORG Tue Jan 25 14:45:45 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8046016A4CE; Tue, 25 Jan 2005 14:45:45 +0000 (GMT) Received: from critter.freebsd.dk (f170.freebsd.dk [212.242.86.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB30943D2D; Tue, 25 Jan 2005 14:45:44 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id j0PEiknI085368; Tue, 25 Jan 2005 15:44:46 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: "M. Warner Losh" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 25 Jan 2005 07:32:58 MST." <20050125.073258.94555150.imp@bsdimp.com> Date: Tue, 25 Jan 2005 15:44:46 +0100 Message-ID: <85367.1106664286@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: rwatson@freebsd.org cc: current@freebsd.org cc: pete@altadena.net Subject: Re: Devd event from GEOM? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 14:45:45 -0000 In message <20050125.073258.94555150.imp@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@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.