NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ATTRIBUTES
$(OS_DIR)/lib/libsysevent.a #include <sys/sysevent.h> #include <libsysevent.h>sysevent_t * sysevent_dup(sysevent_t * ev);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The sysevent_dup() function allocates memory for a system event and copies ev into the newly allocated buffer. This is useful for applications that must continue to use an event buffer beyond the time of event delivery.
The sysevent_free() function deallocates memory associated with an event buffer.
The sysevent_dup() function does not copy the supplied event to another preallocated sysevent buffer but rather allocates memory in the memory heap of the application. The sysevent_free() function can deallocate both regular system events (meaning that the event buffer is returned to the preallocated event pool it comes from) and event duplicates returned by sysevent_dup() .
It is a good policy to release a preallocated event buffer to its pool as early as possible, so that it can be reused to publish further system events.
Also note that it is mandatory to use sysevent_dup() in order to use sysevent_lookup_attr() and sysevent_attr_next() , as these primitives only work on event duplicates where the associated attributes are unpacked.
The sysevent_dup() function returns an event handle upon success, while NULL is returned on failure. The reason for failure is always inability to get memory.
The sysevent_free() function does not return a value.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ATTRIBUTES