build_fd_event — Create an event event relating to an open file descriptor
Event * **build_fd_event** ( | fd, | |
| | mask, | |
| | aggressive, | |
| | callback, | |
| | closure
); | |
int <var class="pdparam">fd</var>;
int <var class="pdparam">mask</var>;
int <var class="pdparam">aggressive</var>;
EventFunc <var class="pdparam">callback</var>;
void *<var class="pdparam">closure</var>;
Create a file descriptor event. The Event structure encapsulates a file descriptor and an action that should be triggered when IO is signalled on that descriptor.
The file descriptor.
The event or events that you are waiting for, for example,
E_READ|E_EXCEPTION. See “Event” for a complete list of the constants applicable to this parameter.
With this parameter set to
E_AGGRESSIVE_NONEthe event callout is invoked once per scheduler iteration. With it set to E_AGGRESSIVE_HIGH it is called in a tight loop until there is no pending IO. This higher setting should only be used if you know what you are doing. See “Event” for a complete list of the constants applicable to this parameter.
The callback function. The requirements for this function are described at “The Event API”.
The closure, the contextual data needed for the event callback to perform its task.
This function returns an Event.
Only call this function from the