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> ev_receive<br />

ev_receive Enables a task to wait for an event condition.<br />

#include <br />

unsigned long ev_receive(<br />

unsigned long events, /* bit-encoded events */<br />

unsigned long flags, /* event processing attributes */<br />

unsigned long timeout, /* timeout delay */<br />

unsigned long *events_r /* events received */<br />

)<br />

Description<br />

Arguments<br />

This service call enables a task to wait for an event condition. The event condition is<br />

a set of user-defined events and an ANY/ALL waiting condition qualifier. Each task<br />

can wait on 32 events, which are bit-encoded in a long word. An ALL condition<br />

occurs when all of the specified events are received. An ANY condition occurs when<br />

one or more of the specified events is received.<br />

If the selected event condition is satisfied by events already pending,<br />

ev_receive() clears those events and returns. Otherwise, ev_receive() can<br />

return immediately with an error, wait until the requisite events have been received,<br />

or wait until a timeout occurs, depending on the flags argument.<br />

If successful, ev_receive() returns the actual events captured by the call in the<br />

location pointed to by events_r.<br />

events Specifies the set of events. An events argument equal to 0 is a<br />

special case, where ev_receive() returns the pending events but<br />

leaves them pending. In this case, the other parameters are ignored.<br />

flags Specifies the event processing attributes. flags is formed by ORing<br />

the following symbolic constants (one from each pair), which are<br />

defined in . For instance, to specify that ev_receive()<br />

blocks until all events are satisfied, you place EV_WAIT and EV_ALL<br />

in flags, using the following syntax:<br />

EV_WAIT | EV_ALL<br />

To specify that ev_receive() blocks until at least one event is<br />

satisfied, you place EV_WAIT and EV_ANY in flags.<br />

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

1

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

Saved successfully!

Ooh no, something went wrong!