Why would you want to do that? To me that sounds like a broken design.
I don’t think that’s possible. Well it could be possible I think, if you’d be willing to rewrite your own version of open.
Or more easely you could write cover fonction for every fonction that uses the handle (open/read/write/etc). For example open would be replace by my_open and so forth. Then in the my_open you would build a cross table of real fd and faked fd. Quite messy ;-0
Even I think also, that there is no way other than modifying the “iofunc_default_open”.
It is really a nice idea to have wrapper function over the default functions. But I am wondering how the Resource Manager will understand the faked id, as this will be communicated to the using application. And htis faked id is not
part of the OCB structure.
The trick has to be performed in the client, not in the resource manager. I don’t think the resource manager as any control over the fd number the client will obtain.
The fake id can be use internaly by the client, but it’s always the READ fd that must be sent to the resource manager.