Ronald Bultje <[EMAIL PROTECTED]> writes:
> Hi Gerd,
>
> On Mon, 2003-01-13 at 11:40, Gerd Knorr wrote:
> > > > Another way would be to have some kind of O_EXCL flag, but at ioctl
> > > > level. So nxtvepg could set that for the S_FREQUENCY ioctl and the
> > > > driver would refuse the switch with -EBUSY if there is more than one
> > > > file handle open at that time.
>
> How is this in effect different from the O_EXCL solution?
You can do basically the same with it. With some O_EXCL-like flag at
ioctl level you just set that flag when doing the ioctl, with
open(O_EXCL) support you would have to close/reopen the device with
O_EXCL set/cleared depending on what you want (as shown in my pseudo
code below). Just a different way.
open(O_EXCL) is aleady used by other drivers, thats why I would
prefeare it, even through it requires the application to some more
system calls.
> > open(/dev/vbi,0)
> > [ read vbi data ]
> > close(/dev/vbi)
> >
> > if (open(/dev/vbi,O_EXCL)) {
> > [ switch station ]
> > close(/dev/vbi)
> > }
> >
> > open(/dev/vbi,0)
> > [ read more vbi data ]
> > close(/dev/vbi)
> >
> > Comments?
>
> Urm... Would this also go for video (as part of the API), or only for
> vbi? Basically, this is bloated, imho.
Look at the floppy driver. Having O_EXCL support is just a few lines
in the drivers open handler.
Gerd
--
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
-- Wacholder in "Melanie"
--
video4linux-list mailing list
Unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/video4linux-list