06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

q_broadcast Broadcasts identical messages to an ordinary message queue.<br />

#include <br />

unsigned long q_broadcast(<br />

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

unsigned long msg_buf[4], /* msg. of 4 long words */<br />

unsigned long *count /* # tasks receiving msg. */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This system call enables the caller to wake up all tasks that might be waiting at an<br />

ordinary message queue. If the task queue is empty, this call does nothing. If one or<br />

more tasks are waiting at the queue, q_broadcast() gives a copy of the input<br />

message to each such task and makes it ready to run. After a q_broadcast() call,<br />

no tasks will be waiting to receive a message from the specified queue.<br />

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

msg_buf Specifies the message to send.<br />

count Points to the variable where q_broadcast() stores the<br />

number of tasks readied by the broadcast.<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 is incorrect, failed validity check.<br />

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

failed validity check.<br />

0x3A ERR_VARQ Queue is variable length.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 1-71<br />

1

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

Saved successfully!

Ooh no, something went wrong!