tomasz <email@example.com> wrote:
I write I driver which register in system as few devices for example
/dev/sample1 /dev/sample2. But in function read/write how can I know
which devices was used to read/write?
On each register, you will pass an attribute structure into the
On the read/write functions, you will be passed an ocb, this is
per-open data, the ocb will point to the attribute structre that
matches the device that was opened.
resmgr_attach(... "/dev/sample1",..., &attr_sample1 );
fd = open("/dev/sample1",...);
write( fd, ... );
io_write( ... iofunc_ocb_t *ocb ... )
ocb->attr is &attr_sample1
QNX Training Services