[openbeos] Re: driver interface question

"Bruno van Dooren" <bruno_van_dooren@xxxxxxxxxxx> wrote:
> for some time now i have been wondering why the declaration of the 
> driver 
> interface posix calls (open, close, ioctl, ...) are split over 3 
> header 
> files? (i don't know by heart which 3, and i don't have a BeOS system 
> nearby 
> at this moment)

The driver interface is in just one header, called <Drivers.h>.
OTOH the corresponding Posix calls are spread over several headers as 
the standard requires. Every function/structure has a prescribed home 
with Posix.

> not to mention the fact that the BeBook does not contain information 
> on how 
> to actually call and use device drivers.

There is a list of some official driver ioctl()s in the drivers 
section.

> i learned it by going through the examples a year ago, but still...
> 
> of course i don't know very much about posix, so my question could be 
> a 
> little silly, but does anyone know the 'why' of this?

Because that part just isn't BeOS specific, but general programming - 
devices are files, and files can be opened; the only way to alter such 
a file is using ioctl(); that's really standard behaviour, and I guess 
that's the reason why it has been left out of the BeBook, just as 
proper network documentation.
I would also guess that you'd know what you do when accessing drivers 
directly.

Adios...
   Axel.


Other related posts: