[Previous] [Contents] [Index] [Next]


MsgReceivePulse(), MsgReceivePulse_r()

Receive a pulse on a channel


#include <sys/neutrino.h>

int MsgReceivePulse( int chid,
                     void * pulse,
                     int bytes,
                     struct _msg_info * info );

int MsgReceivePulse_r( int chid,
                       void * pulse,
                       int bytes,
                       struct _msg_info * info );


The size of the buffer.





The MsgReceivePulse() and MsgReceivePulse_r() kernel calls wait for a pulse to arrive on the channel identified by chid and place the received data in the buffer pointed to by pulse.



Note: The pulse buffer must be big enough to contain a pulse. If it isn't, the functions indicate an error of EFAULT.

If a pulse is waiting on the channel when you call MsgReceivePulse(), the calling thread doesn't block, and the pulse is immediately copied. If a pulse isn't waiting, the calling thread enters the RECEIVE-blocked state until a pulse arrives.


On success, MsgReceivePulse() and MsgReceivePulse_r() return 0 to indicate that they received a pulse. When a pulse is received:

Note: Don't reply to a pulse.

Blocking states

State Meaning
STATE_RECEIVE There's no pulse waiting.


The only difference between MsgReceivePulse() and MsgReceivePulse_r() is the way they indicate errors. On success, they both return 0.

If an error occurred:


A fault occurred when the kernel tried to access the buffers provided. Because the OS accesses the sender's buffers only when MsgReceivePulse() is called, a fault could occur in the sender if the sender's buffers are invalid. If a fault occurs when accessing the sender buffers (only) they'll receive an EFAULT and MsgReceivePulse() won't unblock.
The call was interrupted by a signal.
The channel indicated by chid doesn't exist.
A kernel timeout unblocked the call. See TimerTimeout().


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

MsgDeliverEvent(), MsgReceive(), MsgReceivePulsev(), MsgReceivev(), MsgSendPulse(), _pulse, TimerTimeout()

[Previous] [Contents] [Index] [Next]