Add a waitfor action to an action,
which executes if the corresponding action fails after a specified delay
Synopsis:
#include <ha/ham.h>
int ham_action_fail_waitfor(
ham_action_t *ahdl,
const char *aname,
const char *path,
int delay,
unsigned flags);
Arguments:
- ahdl
- The targeted HAM action handle to which the action-fail item is added.
- aname
- The action-fail item to add.
- path
- The FULL path that is being watched for.
- delay
- The time of delay in milliseconds.
- flags
- Currently not used.
Description:
The ham_action_fail_waitfor() function adds an
action-fail item (aname) to the specified action ahdl.
The action will either delay for delay
milliseconds or wait until path
(if specified) appears in the name space (whichever is earlier).
The path parameter must contain
the FULL path that is being watched for.
The handle (ahdl) is obtained either:
-
from one of the ham_action*() functions to add actions
or:
-
by calling any of the ham_action_handle()
functions to request a handle to a specific action.
The action is executed when the corresponding
action that it is associated with, fails.
Currently, there are no flags defined.
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Errors:
- EBADF
- Couldn't connect to the HAM.
- EEXIST
- The aname name already exists
for the specified ahdl action.
- EINVAL
-
Invalid aname name (e.g., it
contains the / character or is NULL).
- Or:
-
Invalid delay value; only positive values permitted.
- ENAMETOOLONG
-
The name given in aname is too long, (i.e., it exceeds
_POSIX_PATH_MAX, defined in <limits.h>).
Note:
The combined name length of an entity, condition,
or action is also limited by _POSIX_PATH_MAX.
- ENOENT
- There's no entity or condition specified by the given handle (ahdl).
- ENOMEM
- Not enough memory to create a new handle.
In addition to the above errors, the HAM returns any error
it encounters while servicing this request.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |