NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | RESTRICTIONS
#include <cx/wdt.h>int wdt_alloc(wdt_handle_t * handle);
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 wdt_alloc() call allocates a watchdog timer. The allocated timer is in disarmed state. If this call succeeds, a handle for the watchdog timer is placed at the memory location pointed by handle, otherwise, an invalid handle is copied at that place.
The wdt_realloc() call reallocates the watchdog timer represented by * handle , returned by an earlier call to wdt_alloc() . The wdt_realloc() call need not be issued by the same actor that did the original allocation. This grants a new actor to take over watchdog management for an actor that died. If this call succeeds, a new handle for the watchdog timer is placed at the memory location pointed by handle. Otherwise, an invalid handle is copied at that place. The state of the watchdog timer is unchanged by wdt_realloc() . If the device is armed, it is also patted by this call.
The wdt_free() call releases the watchdog timer represented by handle . wdt_free() implicitly disarms the timer. If the owning process exits or is killed while the timer is armed, then the timer remains armed.
On successful completion, wdt_alloc() , wdt_realloc() , and wdt_free() return 0. Otherwise, these calls return -1 and set errno to indicate one of the following error conditions.
No watchdog timer has been configured.
The watchdog timer module has not been configured.
The caller is not the owner of the watchdog timer.
All watchdog timers are already allocated.
The handle points outside the allocated address space of the actor.
The current implementation supports at most one watchdog timer.
If the new actor has no knowledge of the handle returned when the watchdog timer was allocated, then it can set * handle to WDT_MAGIC_HANDLE to reallocate the timer.
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | RESTRICTIONS