Lseek and dup in RM

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.

Thanks!

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().

I’m writing file system RM :slight_smile: 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.