Sends a message.
Err SendMsg( Item mp, Item msg, const void *dataptr, int32 datasize )
This procedure sends a message to the specified message port. (To send a small message use SendSmallMsg()
.
The message is queued on the message port's list of messages according to its priority. Messages that have the same priority are queued on first come, first served basis.
Whether a message is standard or buffered is determined by the procedure you use to create the message: CreateMsg()
creates a standard message (one whose message data belongs to the sending task; the receiving task reads from this block), while CreateBufferedMsg creates a buffered message (one in which a buffer for the message data is included in the message). For standard messages, the dataptr and datasize arguments refer to the data block owned by the message sender. For buffered messages, the dataptr and datasize arguments specify the data to be copied into the message's internal buffer before the message is sent.
If the message is a buffered message, SendMsg()
checks the size of the data block to see whether it will fit in the message's buffer. If it won't fit, SendMsg()
returns an error.
The procedure returns 0 if the message was sent successfully or an error code if an error occurs.
SWI implemented in kernel folio V20.
GetMsg
(), GetThisMsg(), ReplyMsg(), ReplySmallMsg(), SendSmallMsg(), WaitPort()