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_vreceive pSOS+ <strong>System</strong> <strong>Calls</strong><br />

q_vreceive Requests a message from a variable-length message queue.<br />

#include <br />

unsigned long q_vreceive(<br />

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

unsigned long flags, /* queue attributes */<br />

unsigned long timeout, /* timeout in clock ticks */<br />

void *msg_buf, /* message buffer */<br />

unsigned long buf_len, /* length of buffer */<br />

unsigned long *msg_len /* length of message */<br />

)<br />

Description<br />

Arguments<br />

This system call enables a task or an ISR to obtain a message from a variable length<br />

message queue. Otherwise, it is identical to q_receive().<br />

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

flags Specifies whether q_vreceive() will block waiting for a<br />

message. flags should have one of the following values<br />

(defined in ):<br />

Q_NOWAIT /<br />

Q_WAIT<br />

Don't wait / wait for message..<br />

timeout Specifies the timeout interval, in units of clock ticks. If timeout<br />

is zero and Q_WAIT is selected, then q_vreceive() will wait<br />

forever. timeout will be ignored if Q_NOWAIT is selected.<br />

msg_buf Points to the buffer that receives the message.<br />

buf_len Specifies the length of the buffer msg_buf points to. If buf_len<br />

is less than the queue's maximum message length,<br />

ERR_BUFSIZ is returned to the caller.<br />

msg_len Points to the variable where q_receive() stores the actual<br />

length of the received message.<br />

1-98 <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!