Subject: Re: oh yay (pkgsrc/audio/cdd vs cddb)
To: Wolfgang Rupprecht <wolfgang@wsrcc.com>
From: Simon Burge <simonb@wasabisystems.com>
List: current-users
Date: 03/13/2001 10:46:43
Wolfgang Rupprecht wrote:
> Simon Burge writes:
>
> > Would using dup2(2) be a way to hack around this?
>
> I don't think so, if I understand the issue correctly. The man page
> seems to be hinting that the /dev/cd0d's reference count must drop
> down to zero before the driver lets the new disc's data appear to the
> user.
I was thinking of something along the lines of:
close(cdromfd);
tmpfd = open(device, ...);
dup2(tmpfd, cdromfd);
close(tmpfd);
That shouldn't have any ref-count problems (unless of course cdromfd is
dup()'d anywhere else).
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD CDs, Support and Service: http://www.wasabisystems.com/