Hi,
For a course I’m doing this semester I need to make a program which
allocates 32 kb of memory. This same program needs to manage the read and
read/write properties of this memory segment. I tried to do this using the
following:
base = qnx_segment_allocate_flags(32768, _PMR_MODIFY)
and after this setting the flags using:
qnx_segment_flags(base, _PMR_DATA_R+_PMR_MODIFY)
Now the memory is readonly and allocated just the way it’s supposed to be.
Then there is a wait sequence where the memory monitor just waits for a Send
action from a client. Then the monitor makes the segment read/write so the
client can put it’s information there:
qnx_segment_flags(base, _PMR_DATA_RW+_PMR_MODIFY);
(now it sends the base adress to the client so it can begin writing)
This works fine and after the writing is completed the client sends a
message to the monitor. The monitor calls
qnx_segment_flags(base,_PMR_DATA_R+_PMR_MODIFY).
But when the same client tries to write again the segment doesn’t seem to be
blocked. So my question is (the source is currently unavailable :/) how can
I adjust my code in such a way that every client has only the right for one
write action? Is this a limitation of QNX? or am I missing something here?
TIA,
Frostie