06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

q_send pSOS+ <strong>System</strong> <strong>Calls</strong><br />

q_send Posts a message to an ordinary message queue.<br />

#include <br />

unsigned long q_send(<br />

unsigned long qid, /* queue identifier */<br />

unsigned long msg_buf[4] /* message buffer */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call is used to send a message to a specified ordinary message queue. If<br />

a task is already waiting at the queue, the message is passed to that task, which is<br />

then unblocked and made ready to run. If no task is waiting, the input message is<br />

copied into a message buffer from the system pool or, if the queue has private<br />

buffers, into a private message buffer, which is then put in the message queue<br />

behind any messages already posted to the queue.<br />

qid Specifies the queue ID of the target queue.<br />

msg_buf Specifies the message to send.<br />

This system call returns 0 on success, or an error code on failure.<br />

Hex Mnemonic Description<br />

0x05 ERR_OBJDEL Queue has been deleted.<br />

0x06 ERR_OBJID qid incorrect; failed validity check.<br />

0x07 ERR_OBJTYPE Object type doesn’t match object ID;<br />

failed validity check.<br />

0x34 ERR_NOMGB Out of system message buffers.<br />

0x35 ERR_QFULL Message queue at length limit.<br />

1-84 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!