From owner-freebsd-hardware Wed Jan 3 3:28:26 2001 From owner-freebsd-hardware@FreeBSD.ORG Wed Jan 3 03:28:23 2001 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from osiris.ipform.ru (osiris.ipform.ru [212.158.165.98]) by hub.freebsd.org (Postfix) with ESMTP id 8F66637B404; Wed, 3 Jan 2001 03:28:15 -0800 (PST) Received: from wp2 (wp2 [192.168.0.12]) by osiris.ipform.ru (8.11.1/8.11.1) with SMTP id f03BSAb34359; Wed, 3 Jan 2001 14:28:12 +0300 (MSK) (envelope-from matrix@ipform.ru) Message-ID: <013d01c07578$41954200$0c00a8c0@ipform.ru> From: "Artem Koutchine" To: Cc: Subject: Detecting a cd media inertion by polling Date: Wed, 3 Jan 2001 14:16:07 +0300 Organization: IP Form MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hello! I tried to impliment a cd detection by polling the cd-rom device every second. But i failed. The problem is that opening /dev/acd0c is always success even if the media is not inserted, even read() is sucessfull, it just read 0 bytes. I could use mount() call to try to mount cd9660, but that seems to be an overkill. Any idea how to detect media insertion reliably and properly? Artem To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message