Markus Loffler <firstname.lastname@example.org> wrote:
When I call ChannelCreate(), I have the choice if I want to receive system
pulses (_NTO_CHF_DISCONNECT, _NTO_CHF_UNBLOCK).
However, using name_create, I don’t have that choice. Why? Can I change
these flags later?
Using name_attach/name_open, you can’t turn off the flags. (I assume
that is what you mean by name_create.)
If I can’t turn system pulses off, can I detect them after a call of
MsgReceive() and distinguish them from my messages by any other means than
looking if the first 32 bit are 0?
Actually, you shouldn’t look at the first 32 bits.
MsgReceive() will return 0 (not a rcvid) if you’ve received a pulse. This
should be the first thing you check.
Then, check the pulse code – pulse.code – the range 0 to
_PULSE_CODE_MAXAVAIL is available for user pulses, any pulse code
greater than _PULSE_CODE_MAXAVAIL is a system pulse. If you don’t
want to deal with system pulses, you can throw them away. Of course,
you should probably deal with an unblock pulse in a reasonable way, but
you don’t have to. (For reference, _PULSE_CODE_MAXAVAIL is 127, this
means that 0-127 is available, 128-255 [i.e. all pulse with the high bit
set in the code] are reserved for system use.)