ET System  16.4
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Events

These routines handle events. More...

Modules

 Single event
 These routines handle the elements of a single event.
 

Functions

int et_event_new (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime, size_t size)
 This routine is called when a user wants a blank or fresh event from the ET system into which data can be placed. More...
 
int et_events_new (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, size_t size, int num, int *nread)
 This routine is called when a user wants an array of blank or fresh events from the ET system into which data can be placed. More...
 
int et_event_new_group (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime, size_t size, int group)
 This routine is called when a user wants a blank or fresh event from the ET system into which it can place data and that event must belong to the given group. More...
 
int et_events_new_group (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, size_t size, int num, int group, int *nread)
 This routine is called when a user wants an array of blank or fresh event from the ET system into which it can place data and those events must belong to the given group. More...
 
int et_event_get (et_sys_id id, et_att_id att, et_event **pe, int mode, struct timespec *deltatime)
 This routine is called when a user wants to read a single event from the ET system. More...
 
int et_events_get (et_sys_id id, et_att_id att, et_event *pe[], int mode, struct timespec *deltatime, int num, int *nread)
 This routine is called when a user wants to read an array of events from the ET system. More...
 
int et_event_put (et_sys_id id, et_att_id att, et_event *pe)
 This routine is called when a user wants to return a single, previously read or new event into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station. More...
 
int et_events_put (et_sys_id id, et_att_id att, et_event *pe[], int num)
 This routine is called when a user wants to return an array of previously read or new events into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station. More...
 
int et_event_dump (et_sys_id id, et_att_id att, et_event *pe)
 This routine is called when a user wants to get rid of a single, previously read or new event so that no user processes downstream will ever see it. More...
 
int et_events_dump (et_sys_id id, et_att_id att, et_event *pe[], int num)
 This routine is called when a user wants to get rid of an array of previously read or new events so that no user processes downstream will ever see them. More...
 

Detailed Description

These routines handle events.

Function Documentation

int et_event_dump ( et_sys_id  id,
et_att_id  att,
et_event pe 
)

This routine is called when a user wants to get rid of a single, previously read or new event so that no user processes downstream will ever see it.

It is placed directly into the ET system's ET_GRANDCENTRAL station which recycles it. This will never block.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pepointer to the event to return to the ET system.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), event not owned by attachment, error unmapping temp event
ET_ERROR_CLOSED if et_close already called
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead

References et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_dump(), et_system_lock(), et_system_unlock(), et_temp_remove(), etn_event_dump(), etr_event_dump(), et_attach::events_dump, et_event_t::filename, et_id_t::locality, et_event_t::memsize, et_system_t::ntemps, et_event_t::owner, et_event_t::pdata, et_id_t::sys, and et_event_t::temp.

int et_event_get ( et_sys_id  id,
et_att_id  att,
et_event **  pe,
int  mode,
struct timespec *  deltatime 
)

This routine is called when a user wants to read a single event from the ET system.

The 4th argument has a number of options. The ET_SLEEP option waits until an event is available before it returns and therefore may "hang". The ET_TIMED option returns after a time set by the last argument. Finally, the ET_ASYNC option returns immediately whether or not it was successful in obtaining a new event for the caller.

For remote users, the previously mentioned macros may be ORed with ET_MODIFY. This indicates to the ET server that the user intends to modify the data and so the server must NOT place the event immediately back into the ET system, but must do so only when et_event_put is called. Alternatively, instead of ET_MODIFY, ET_MODIFY_HEADER can be used when the user intends to modify only the meta data. This avoids sending all the data over the network.

For remote users, if neither ET_MODIFY nor ET_MODIFY_HEADER are used, the previously mentioned macros may be ORed with ET_DUMP. Normally, ET events on the server are sent over the network to the client and then immediately put back into the system. If this flag is used, the server dumps the events instead (they're sent directly back to Grand Central).

For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pea pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe".
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED.
deltatimeused only with the mode = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), attachment not active, group is < 1, or group > ET system?s highest group number
ET_ERROR_CLOSED if et_close already called
ET_ERROR_REMOTE for a memory allocation error of a remote user
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event
ET_ERROR_TIMEOUT if timeout on ET_TIMED option
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode

References et_system_t::attach, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_WAKEUP, ET_EVENT_TEMP, ET_GRANDCENTRAL, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_read(), et_temp_attach(), ET_TIMED, ET_WAIT_MASK, etn_event_get(), etr_event_get(), et_attach::events_get, et_attach::stat, and et_attach::status.

int et_event_new ( et_sys_id  id,
et_att_id  att,
et_event **  pe,
int  mode,
struct timespec *  deltatime,
size_t  size 
)

This routine is called when a user wants a blank or fresh event from the ET system into which data can be placed.

Performance will generally be best with the ET_SLEEP mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all(), or et_wakeup_attachment() on the attachment while waiting to read an event.

In remote operation it is possible to avoid memory allocation for data in this routine and use an existing buffer to hold data for this new event. Do this by ANDing the ET_NOALLOC flag with the other mode flag (ET_SLEEP etc). In this case, the user must also call et_event_setdatabuffer in order to set the data buffer explicitly for this event. This buffer will NOT be freed when doing an et_event_put or et_event_dump.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pea pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe".
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller.
deltatimeused only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
sizethe number of bytes desired for the event's data.
Returns
ET_OK if successful.
ET_ERROR if bad argument(s), attachment not active.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_REMOTE for a memory allocation error of a remote user.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event.
ET_ERROR_TIMEOUT if timeout on ET_TIMED option.
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode.
ET_ERROR_TOOMANY if too many temp events have been made and no more available.

References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, et_event_new_group(), ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_read(), ET_TIMED, ET_WAIT_MASK, etn_event_new(), etr_event_new(), et_sys_config_t::event_size, et_attach::events_make, et_event_t::group, et_system_t::hz, et_sys_config_t::ntemps, et_system_t::ntemps, and et_attach::status.

int et_event_new_group ( et_sys_id  id,
et_att_id  att,
et_event **  pe,
int  mode,
struct timespec *  deltatime,
size_t  size,
int  group 
)

This routine is called when a user wants a blank or fresh event from the ET system into which it can place data and that event must belong to the given group.

Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to read an event.

In remote operation it is possible to avoid memory allocation for data in this routine and use an existing buffer to hold data for this new event. Do this by ANDing the ET_NOALLOC flag with the other mode flag (ET_SLEEP etc). In this case, the user must also call et_event_setdatabuffer in order to set the data buffer explicitly for this event. This buffer will NOT be freed when doing an et_event_put or et_event_dump.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pea pointer to a pointer to an event. Declare it a pointer to an event such as "et_event *pe;" and pass it as "&pe".
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller.
deltatimeused only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
sizethe number of bytes desired for the event's data.
groupis the group number of event to be acquired
Returns
ET_OK if successful
ET_ERROR if bad argument(s), attachment not active, group is < 1, or group > ET system?s highest group number
ET_ERROR_CLOSED if et_close already called
ET_ERROR_REMOTE for a memory allocation error of a remote user
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event
ET_ERROR_TIMEOUT if timeout on ET_TIMED option
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode

References et_events_new_group().

Referenced by et_event_new().

int et_event_put ( et_sys_id  id,
et_att_id  att,
et_event pe 
)

This routine is called when a user wants to return a single, previously read or new event into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station.

This will never block.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pepointer to the event to return to the ET system.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), event not owned by attachment, event data length > ET event size, error unmapping temp event
ET_ERROR_CLOSED if et_close already called
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_REMOTE bad pointer to data of a remote user

References et_event_t::age, et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_EVENT_USED, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_write(), etn_event_put(), etr_event_put(), et_attach::events_put, et_event_t::length, et_id_t::locality, et_event_t::memsize, et_event_t::owner, et_event_t::pdata, et_attach::stat, et_id_t::sys, and et_event_t::temp.

int et_events_dump ( et_sys_id  id,
et_att_id  att,
et_event pe[],
int  num 
)

This routine is called when a user wants to get rid of an array of previously read or new events so that no user processes downstream will ever see them.

They are placed directly into the ET system's ET_GRANDCENTRAL station which recycles them. This will never block.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pearray of events to return to the ET system.
numnumber of events to return to the ET system.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), event not owned by attachment, error unmapping temp event
ET_ERROR_CLOSED if et_close already called
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead

References et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_ndump(), et_system_lock(), et_system_unlock(), et_temp_remove(), etn_events_dump(), etr_events_dump(), et_attach::events_dump, et_id_t::locality, et_system_t::ntemps, and et_id_t::sys.

int et_events_get ( et_sys_id  id,
et_att_id  att,
et_event pe[],
int  mode,
struct timespec *  deltatime,
int  num,
int *  nread 
)

This routine is called when a user wants to read an array of events from the ET system.

The 4th argument has a number of options. The ET_SLEEP option waits until events are available before it returns and therefore may "hang". The ET_TIMED option returns after a time set by the last argument. Finally, the ET_ASYNC option returns immediately whether or not it was successful in obtaining new events for the caller.

For remote users, the previously mentioned macros may be ORed with ET_MODIFY. This indicates to the ET server that the user intends to modify the data and so the server must NOT place the events immediately back into the ET system, but must do so only when et_event_put is called. Alternatively, instead of ET_MODIFY, ET_MODIFY_HEADER can be used when the user intends to modify only the meta data. This avoids sending all the data over the network.

For remote users, if neither ET_MODIFY nor ET_MODIFY_HEADER are used, the previously mentioned macros may be ORed with ET_DUMP. Normally, ET events on the server are sent over the network to the client and then immediately put back into the system. If this flag is used, the server dumps the events instead (they're sent directly back to Grand Central).

For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.

If all processes in an ET system use block transfers such as this one, a speed increase of over 10X the single transfer rate is possible. For remote users, not specifying ET_MODIFY (and to a lesser extent ET_MODIFY_HEADER) greatly increases ET system efficiency as extra communication between user & system and extra copying of the event data are avoided. The error of ET_ERROR_WAKEUP is returned when a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to get an event.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pearray of event pointers.
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED.
deltatimeused only with the mode = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
numthe number of desired events.
nreadpointer which is filled with the number of events actually returned.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), attachment not active, group is < 1, or group > ET system?s highest group number
ET_ERROR_CLOSED if et_close already called
ET_ERROR_REMOTE for a memory allocation error of a remote user
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event
ET_ERROR_TIMEOUT if timeout on ET_TIMED option
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode

References et_system_t::attach, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_WAKEUP, ET_EVENT_TEMP, ET_GRANDCENTRAL, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread(), et_temp_attach(), ET_TIMED, ET_WAIT_MASK, etn_events_get(), etr_events_get(), et_attach::events_get, et_event_t::pdata, et_attach::stat, and et_attach::status.

int et_events_new ( et_sys_id  id,
et_att_id  att,
et_event pe[],
int  mode,
struct timespec *  deltatime,
size_t  size,
int  num,
int *  nread 
)

This routine is called when a user wants an array of blank or fresh events from the ET system into which data can be placed.

If all processes in an ET system use block transfers such as this one, a speed increase of over 10X the single transfer rate is possible. Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment while waiting to read an event.

In remote operation it is possible to avoid memory allocation for data in this routine and use existing buffers to hold data for these new events. Do this by ANDing the ET_NOALLOC flag with the other mode flag (ET_SLEEP etc). In this case, the user must also call et_event_setdatabuffer in order to set the data buffer explicitly for each event. These buffers will NOT be freed when doing an et_events_put or et_events_dump.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pearray of event pointers.
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller.
deltatimeused only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
sizethe number of bytes desired for an event's data.
numthe number of desired events.
nreadpointer which is filled with the number of events actually returned.
Returns
ET_OK if successful.
ET_ERROR if bad argument(s), attachment not active,
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_REMOTE for a memory allocation error of a remote user.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event.
ET_ERROR_TIMEOUT if timeout on ET_TIMED option.
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode.
ET_ERROR_TOOMANY if too many temp events have been made and no more available.

References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, et_events_new_group(), ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread(), ET_TIMED, ET_WAIT_MASK, etn_events_new(), etr_events_new(), et_sys_config_t::event_size, et_attach::events_make, et_event_t::group, et_system_t::hz, et_event_t::length, et_event_t::memsize, et_sys_config_t::ntemps, et_system_t::ntemps, et_event_t::pdata, and et_attach::status.

int et_events_new_group ( et_sys_id  id,
et_att_id  att,
et_event pe[],
int  mode,
struct timespec *  deltatime,
size_t  size,
int  num,
int  group,
int *  nread 
)

This routine is called when a user wants an array of blank or fresh event from the ET system into which it can place data and those events must belong to the given group.

Performance will generally be best with the ET_SLEEP wait mode. It will slow with ET_TIMED, and will crawl with ET_ASYNC. All this routine does for a remote client is allocate memory in which to place event data. The error of ET_ERROR_WAKEUP is returned when the ET system dies, or a user calls et_wakeup_all() or et_wakeup_attachment() on the attachment, while waiting to read an event.

In remote operation it is possible to avoid memory allocation for data in this routine and use existing buffers to hold data for these new events. Do this by ANDing the ET_NOALLOC flag with the other mode flag (ET_SLEEP etc). In this case, the user must also call et_event_setdatabuffer in order to set the data buffer explicitly for each event. These buffers will NOT be freed when doing an et_events_put or et_events_dump.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pearray of event pointers.
modeeither ET_SLEEP, ET_ASYNC, or ET_TIMED. The sleep option waits until an event is available before it returns and therefore may "hang". The timed option returns after a time set by the last argument. Finally, the async option returns immediately whether or not it was successful in obtaining a new event for the caller.
deltatimeused only with the wait = ET_TIMED option, where it gives the time to wait before returning. For other options it will be ignored.
sizethe number of bytes desired for the event's data.
numthe number of desired events.
groupis the group number of event to be acquired
nreadpointer which is filled with the number of events actually returned.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), attachment not active, group is < 1, or group > ET system?s highest group number
ET_ERROR_CLOSED if et_close already called
ET_ERROR_REMOTE for a memory allocation error of a remote user
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_WAKEUP if told to stop sleeping while trying to get an event
ET_ERROR_TIMEOUT if timeout on ET_TIMED option
ET_ERROR_BUSY if cannot access events due to activity of other processes when in ET_ASYNC mode.
ET_ERROR_EMPTY if no events available in ET_ASYNC mode

References et_system_t::attach, et_system_t::config, et_alive(), ET_ASYNC, ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, ET_ERROR_WAKEUP, ET_GRANDCENTRAL, et_init_event_(), ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_PDATA2USR, ET_REMOTE, ET_SLEEP, et_station_nread_group(), ET_TIMED, ET_WAIT_MASK, etn_events_new_group(), etr_events_new_group(), et_sys_config_t::event_size, et_attach::events_make, et_system_t::hz, et_event_t::length, et_event_t::memsize, et_sys_config_t::ntemps, et_system_t::ntemps, et_event_t::pdata, and et_attach::status.

Referenced by et_event_new_group(), and et_events_new().

int et_events_put ( et_sys_id  id,
et_att_id  att,
et_event pe[],
int  num 
)

This routine is called when a user wants to return an array of previously read or new events into the ET system so processes downstream can use it or so it can be returned to ET_GRANDCENTRAL station.

This will never block.

Parameters
idid of the ET system of interest.
attthe attachment id. This is obtained by attaching the user process to a station with et_station_attach.
pearray of events to return to the ET system.
numnumber of events to return to the ET system.
Returns
ET_OK if successful
ET_ERROR if bad argument(s), event not owned by attachment, event data length > ET event size, error unmapping temp event
ET_ERROR_CLOSED if et_close already called
ET_ERROR_READ for a remote user's network read error
ET_ERROR_WRITE for a remote user's network write error
ET_ERROR_DEAD if ET system is dead
ET_ERROR_REMOTE bad pointer to data or memory allocation error of a remote user

References et_event_t::age, et_system_t::attach, et_id_t::closed, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_EVENT_TEMP, ET_EVENT_USED, ET_LOCAL_NOSHARE, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, et_station_nwrite(), etn_events_put(), etr_events_put(), et_attach::events_put, et_id_t::locality, et_event_t::modify, et_attach::stat, and et_id_t::sys.