waitfor_attach()
QNX SDP8.0C Library ReferenceAPIDeveloper
Wait until there is hash of an attached path that matches the specified path
Synopsis:
#include <libgen.h>
int waitfor_attach( const char *path,
int delay_ms );
Arguments:
- path
- The path you want to wait for.
- delay_ms
- The maximum time, in milliseconds, that you want to wait for.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The waitfor_attach() function checks a hash calculated by the path manager from a path attached by resmgr_attach() and, if a match found, confirms the presence of the waited for path with a stat(). It is more efficient than waitfor() when waiting for a mountpoint.
Note:
Do not call waitfor_attach() on regular files because it will block until delay_ms expires.
Example:
waitfor_attach( "/dev/ram0", delayms );
The only valid path formation must be an absolute path without extra slashes because the implementation performs no correction for the hash returned.
- Valid path formation:
/dev/ram0
- Invalid path formation:
/dev//ram0 ../dev/ram0 ./dev/ram0 /dev/ram0/
Returns:
- 0
- The path exists.
- -1
- An error occurred (errno is set).
Classification:
Safety: | |
---|---|
Cancellation point | Yes |
Signal handler | No |
Thread | Yes |
Page updated: