NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libsysevent.a #include <libsysevent.h> #include <libnvpair.h>int sysevent_post_event(char * class, char * subclass, char * vendor, char * publisher, nvlist_t * attr_list, sysevent_id_t * eid);
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.
Identifier of the queue to which the event must be posted
Pointer to a string defining the event class
Pointer to a string defining the event subclass
Pointer to a string defining the vendor
Pointer to a string defining the event's publisher name
Pointer to an nvlist_t , listing the name-value attributes associated with the event, NULL if there are no such attributes for this event
Pointer to a system unique identifier.
The sysevent_post_event() and _sysevent_post_event() functions cause a system event, of the specified class , subclass , vendor and publisher , to be generated on behalf of the caller and queued for delivery to user-level applications.
These calls only differ by the additional parameter of _sysevent_post_event() , which specifies to which event queue the event must be posted.
At least four event queues are available:
Used by the microkernel to publish events
Used by the device drivers to publish events
Used by the operating system to publish event
Aliased to SE_DEFAULT_QUEUE , which is suitable for the user-level applications to publish their system events. This is the queue used by sysevent_post_event()
In addition to these predefined queues, a number of extra event queues can be optionally configured at the core system event level. These optional queues are identified by an index number that starts at 0 for the first extra queue.
The vendor must be the company stock symbol of the event posting application. The publisher should be the name of the application generating the event.
For example, all events posted by Sun applications begin with the company's stock symbol, SUNW . The publisher is usually the name of the application generating the system event.
The publisher information is used by sysevent consumers to filter unwanted event publishers.
Upon successful queuing of the system event, a unique identifier is assigned to * eid .
Upon successful completion, sysevent_post_event() and _sysevent_post_event() return 0. Otherwise, they return -1 and set errno to indicate one of the following error conditions.
Insufficient resources to queue the system event
Invalid argument; mostly set if one of the following conditions is met
The subclass , vendor or publisher argument is a null address
The class string is greater than MAX_CLASS_LEN
The subclass string is greater than MAX_SUBCLASS_LEN
The concatenated vendor and publisher strings are greater than MAX_PUB_LEN - 16
Permission denied
No available system event.
The system event feature is not configured or no system event server is available.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
sysevent_get_event(3EXT) , _sysevent_get_event(3EXT) , sysevent_alloc_event(3EXT) , nvlist_alloc(3EXT) , nvlist_free(3EXT) , nvlist_add_boolean(3EXT) , nvlist_add_byte(3EXT) , nvlist_add_int16(3EXT) , nvlist_add_uint16(3EXT) , nvlist_add_int32(3EXT) , nvlist_add_uint32(3EXT) , nvlist_add_int64(3EXT) , nvlist_add_uint64(3EXT) , nvlist_add_string(3EXT) , nvlist_add_byte_array(3EXT) , nvlist_add_int16_array(3EXT) , nvlist_add_uint16_array(3EXT) , nvlist_add_int32_array(3EXT) , nvlist_add_uint32_array(3EXT) , nvlist_add_int64_array(3EXT) , nvlist_add_uint64_array(3EXT) , nvlist_add_string_array(3EXT) , nvlist_add_hrtime(3EXT)
NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO