I can’t be sure since you don’t show a prototype, but it looks like you aren’t specifying sharing at all. The sharing should therefore become O_SHARE_RDWR.
But then it looks like you’re also applying permissions of O_SHARE_NONE.
O_SHARE_NONE resolves to 000002000000, but <i>mode</i> is type mode_t which is unsigned int. I’m pretty sure you don’t want to be assigning the O_SHARE_NONE macro value to the <i>mode</i> parameter.
What you were probably thinking was something more like:<pre>
myOFLAG = %bitor( O_RdOnly:O_Share_None ) ;
Open( FileName:myOFLAG ) ;</pre>
By using the <i>mode</i> parameter, you were setting permission bits on the file. What you needed to be thinking was that <i>oflag</i> is actually a series of bits that are either on or off. By ORing the related macro values together, you pass the combination of O_RdOnly and O_Share_None into that single parameter.
Now, I don’t know how XML-INTO reacts to different states of an opened file descriptor, so you’ll probably still need to experiment. But maybe this has shed a little light on how open() can be used. It’s definitely different from OPEN.