NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES
#include <sysevent.h>int sysevent_add_attr(sysevent_attr_list_t ** ev_attr_list, char * name, sysevent_value_t * attr_value, int flag);
typedef struct sysevent_bytes { int32_t size; uchar_t *data; } sysevent_bytes_t; typedef struct sysevent_ints32 { int32_t size; int32_t *data; } sysevent_ints32_t; typedef struct sysevent_uints32 { uint32_t size; uint32_t *data; } sysevent_ints32_t; typedef struct sysevent_value { int32_t value_type; union { uchar_t sv_byte; int16_t sv_int16; int32_t sv_int32; uint16_t sv_uint16; uint32_t sv_uint32; int64_t sv_int64; hrtime_t sv_time; uint64_t sv_uint64; char *sv_string; sysevent_bytes_t sv_bytes; sysevent_int32_t sv_ints32; sysevent_uint32_t sv_uints32; } value; } sysevent_value_t
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.
Event attribute list handle
Attribute value
Specify memory policy, either KM_SLEEP or KM_NOSLEEP
The sysevent_add_attr() function adds the attribute (name-value pair) specified by name and attr_value to the attribute list, *ev_attr_list . If ev_attr_list is NULL , allocation for a new attribute list is performed and the name-value attribute specified by name and attr_value is added. The *ev_attr_list parameter is updated to point to the newly allocated list.
Attribute memory allocated with sysevent_add_attr() may be de-allocated with a call to sysevent_free_attr() if the attribute list has not been attached to an event buffer. (via sysevent_attach() ) Otherwise, sysevent_free() or sysevent_detach_attributes() will free the attached attribute list during de-allocation or detachment of the event buffer.
The sysevent_free_attr() function frees the memory associated with the attribute list, ev_attr_list . The attribute list must not be attached to an event buffer.
The attribute value structure is a self-defining structure that contains a data type specifier and appropriate union members to hold the value of the data specified.
Possible values for sv_datatype are:
8-bit type
16-bit integer
16-bit unsigned integer
32-bit integer
32-bit unsigned integer
64-bit integer
64-bit unsigned integer
64-bit integer
Null-terminated character string not to exceed MAX_STRING_SZ
Unsigned byte string not to exceed MAX_BYTE_ARRAY
Integer array not to exceed MAX_INT32_ARRAY
Unsigned integer array not to exceed MAX_UINT32_ARRAY
The sysevent_add_attr() function can be called from the interrupt context only if the KM_NOSLEEP flag is set. It can be called from user context with any valid flag .
Note that the SE_DATA_TYPE_INTS32 and SE_DATA_TYPE_UINTS32 data types are not supported by the native Solaris sysevent microkernel API .
The sysevent_add_attr() function returns 0 upon success. Otherwise, an error code is returned to indicate the error that has occurred.
The sysevent_free_attr() function returns no value.
Unable to allocate memory. Occurs only if KM_NOSLEEP is specified
Invalid attribute name or value
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES