In Krten’s book (Getting Started with Neutrino 2.0, first printing, p. 285),
he
suggests using (ioflag & _READ) or (ioflag & _WRITE) to check the open
mode of a resource manager. In QNX 6.0, _READ and _WRITE are defined in
stdio.h. In QNX 6.1, they are nowhere to be found.
What is the “proper” way to check the open mode of a resource manager in
6.1?
In Krten’s book (Getting Started with Neutrino 2.0, first printing, p.
285),
he
suggests using (ioflag & _READ) or (ioflag & _WRITE) to check the open
mode of a resource manager. In QNX 6.0, _READ and _WRITE are defined in
stdio.h. In QNX 6.1, they are nowhere to be found.
What is the “proper” way to check the open mode of a resource manager
in
6.1?
Where is this documented?
Check out iofunc_read_verify() in the documents. If you really want to use
_READ _WRITE you can always define them:
#define _READ 0x0001 #define _WRITE 0x0002
Actually really what you want to do is use _IO_FLAG_RD and
_IO_FLAG_WR from <sys/iomsg.h>. If you look at the connect
message:
Actually really what you want to do is use _IO_FLAG_RD and
_IO_FLAG_WR from <sys/iomsg.h>. If you look at the connect
message:
Yes, definately a better idea.
Perhaps if you wish to compile on both the 6.0 and 6.1A you could make you
own macro set (MY_READ, MY_WRITE) to define the proper macro for
compilation.
-Adam
Actually, _IO_FLAG_RD and _IO_FLAG_WR are defined in <sys/iomsg.h
in 6.0 as well, so it makes sense to use them directly. Thanks everyone!
In Krten’s book (Getting Started with Neutrino 2.0, first printing, p.
285),
he
suggests using (ioflag & _READ) or (ioflag & _WRITE) to check the open
mode of a resource manager. In QNX 6.0, _READ and _WRITE are defined in
stdio.h. In QNX 6.1, they are nowhere to be found.
What is the “proper” way to check the open mode of a resource manager
in
6.1?
Where is this documented?
Check out iofunc_read_verify() in the documents. If you really want to use
_READ _WRITE you can always define them:
Actually really what you want to do is use _IO_FLAG_RD and
_IO_FLAG_WR from <sys/iomsg.h>. If you look at the connect
message:
Yes, definately a better idea.
Perhaps if you wish to compile on both the 6.0 and 6.1A you could make you
own macro set (MY_READ, MY_WRITE) to define the proper macro for
compilation.