Subject: Re: oh yay (pkgsrc/audio/cdd vs cddb)
To: Wolfgang Rupprecht <>
From: Simon Burge <>
List: current-users
Date: 03/13/2001 09:44:58
Wolfgang Rupprecht wrote:

> A side question:  Netbsd's cdrom driver seems to try to "help" the
> user by not allowing the CD information that the kernel presents to
> userland to be updated while the cdrom device-file is open.  The grip
> code does this to try to detect when a new disc is inserted:
>                 while(1){
>                     ret = ioctl(cdromfd, CDIOCREADSUBCHANNEL, &discstatus);
>                     ... 
>                 }
> Netbsd is effectively "protecting" the user from a quick game of
> three-disc-monte, where the cdrom changes unexpectedly.  The problem
> is that this feature is not included in any other common OS, so the
> grip code never got structured to allow some lowlevel code to "burp"
> the cdrom file by closing it and opening it.  (cdromfd was passed by
> value, so even doing a quick close()/open() on cdromfd was very
> painful and unclean.

Would using dup2(2) be a way to hack around this?

Simon Burge                            <>
NetBSD CDs, Support and Service: