msg->connect.ioflag

I check this (msg->connect.ioflag) inside of my open handler function to see
what the OFLAG was for the open request. It always seems to be 1+ the OFLAG.
Is this correct?

“Chris Rose” <chris.rose@viasat.com> wrote in
news:a533jj$m0m$1@inn.qnx.com:

I check this (msg->connect.ioflag) inside of my open handler function
to see what the OFLAG was for the open request. It always seems to be
1+ the OFLAG. Is this correct?

Yes. This allows the LSB to be used for _READ or _WRITE permission
checking.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Adam Mallory <amallory@qnx.com> wrote in
news:Xns91BD67C5E8067amalloryqnxcom@209.226.137.4:

“Chris Rose” <> chris.rose@viasat.com> > wrote in
news:a533jj$m0m$> 1@inn.qnx.com> :

I check this (msg->connect.ioflag) inside of my open handler function
to see what the OFLAG was for the open request. It always seems to be
1+ the OFLAG. Is this correct?

Yes. This allows the LSB to be used for _READ or _WRITE permission
checking.

The use of _READ/_WRITE should be _IO_FLAG_RD and _IO_FLAG_WR

So, if a client passes O_RDONLY in, the RM should check the permissions via
msg->connect.ioflag & _IO_FLAG_RD .

As a style note, it’s a bad idea to assume that the result will always be
+1, that’s what the #defines are for.



\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>