View topic - Lseek and dup in RM

Page 1 of 1

Lseek and dup in RM

PostPosted: Sun Jul 09, 2017 3:49 pm
by Igorsv94
Hello everybody!

I'm writing RM and I need some help with I/O lseek and dup.
I didn't find source code for it, so I'm here.

Please describe this functions for me or give me source code.

P.S. I had read so many times Krten's books about RM.


Re: Lseek and dup in RM

PostPosted: Sun Jul 09, 2017 5:27 pm
by maschoen
The code for dup() is pretty standard. If you are using QNX 6 you should just use the default RM behavior. If you are using QNX 4 there are a number of available examples on how to implement this. If you can't find any, reply and I will get one for you.

lseek() is typically only supported in resource managers controlling a file system. Unless you are writing a file system manager for a new file system, you don't need to support it. Since QNX the company has always been rather tight lipped about QNX 6 file system code, you shouldn't need this. Just return a -1 to indicate that it is unsupported in your RM>

That said a non-disk device resource manager could support the call in some idiosyncratic purpose, for example it could be used to position a servo. A better way to do this would be using devctl().

Re: Lseek and dup in RM

PostPosted: Fri Jul 14, 2017 6:34 am
by Igorsv94
I'm writing file system RM :) forgot to say.
I'm using own ocb and iofunc_attr , so I need to modify both functions lseek and dup.
In lseek I want to set position in depends of data-field from my ocb.
In dup I want to modify my table of descriptors.