Add an event to be triggered when a monitored value crosses a trigger point
#include <sys/procmgr.h> int procmgr_value_notify_add( unsigned type, int sub_id, uint64_t value, const struct sigevent *event );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
You can OR this with one of the following:
The procmgr_value_notify_add() function sets up an event to be triggered when the value being monitored crosses the trigger point up (PROCMGR_VALUE_TRIGGER_UP) or down (PROCMGR_VALUE_TRIGGER_DOWN).
For example, PROCMGR_VALUE_FREE_MEM | PROCMGR_VALUE_TRIGGER_DOWN causes the event to be delivered when the system free memory drops to the specified trigger value.
If you just want to read the value with procmgr_value_current(), don't specify either of the trigger bits.
To delete the notification, call procmgr_event_notify_delete(), passing it the ID that procmgr_value_notify_add() returns.
An event ID, or -1 if there was an error (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |