NAME | SYNOPSIS | API RESTRICTIONS | PARAMETERS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES
#include <sys/sysevent.h>int log_sysevent(sysevent_t *ev, int flag, sysevent_id_t *idp);
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.
Handle pointing to an event structure
Flag to indicate if the thread should wait for memory, either KM_SLEEP or KM_NOSLEEP
Pointer to a unique event ID
The log_sysevent() function posts an event from the operating system to be consumed by userland processes. The call is responsible for packing the event header data as well as the attribute list into a contiguous buffer which it allocates and manages. The repacked buffer is queued and userland delivery of the buffer is initiated. The repacked buffer is freed once userland delivery has been made.
If the call is successful, the event is handed to the sysevent framework. A unique event ID is returned to the caller in *idp. The idp parameter points to a sysevent_id structure, defined as follows:
typedef struct sysevent_id { uint64_t eid_seq; hrtime_t eid_ts; } sysevent_id_t |
If the call fails, an error code is returned to the caller. The caller should either retry or call sysevent_free() to de-allocate memory associated with the event header and attribute list.
Upon successful completion of a call to log_sysevent(), the caller is responsible for de-allocating the event buffer by calling sysevent_free().
The log_sysevent() function can be called from the C_OS interrupt context only if the KM_NOSLEEP flag is set. It can be called from normal context with any valid flag.
System events are posted to the event queue specified when the event buffer is allocated
0 is returned for a successful queueing of the system event. Otherwise, an error condition is returned to indicate that the event was not queued.
Insufficient memory was available to pack the event buffer for userland delivery
Maximum event queue size reached
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