XRECEIVE - receive a message from a specific task
- Input
-
-
C=1 - waits for any message
-
C=0 - returns immediately with an error if no message received
-
XR - task the message is expected from
-
- Call
-
jsr XRECEIVE
- Output
-
-
C=1 - error
-
AC - error code
-
-
C=0 - success
-
XR - sender task ID
-
YR - number of bytes received in PCBUF
-
AC - message type (if given by sender)
-
-
XRECEIVE receives a message. It behaves exactly like the RECEIVE(2) call, with the exception that only messages from the given task ID are accepted.
In an RPC client, this could be used to accept only messages from the task that received the original message. For this SEND(2) returns the task ID of the destination call in XR.
Note
|
to protect the SENDBUF resource, the SEM_SENDBUF semaphore must be held by the sender. The ownership of the SENDBUF semaphore changes to the receiving task (that executes this XRECEIVE). Thus the SEM_SENDBUF must be released after receiving a message. |
Error return codes are given when at return, C=1.
- E_NOTX
-
if non-blocking, and no message could be received.
- E_INT
-
a blocking RECEIVE call was interrupted by a signal handler, while SIG_INT was set.
Please report bugs at https://github.com/fachat/GeckOS-V2/issues