Verify handle to a power managed object
#include <sys/pm.h>
int pm_valid_hdl(pm_hdl_t hdl);
- hdl
- Handle to the power managed object -- obtained via pm_attach().
libpm
The pm_valid_hdl() verifies if the supplied handle is
a valid handle to a power managed object.
- A non-zero value
- hdl is a valid handle.
- 0
- hdl is not a valid handle.
#include <sys/pm.h>
#include <fcntl.h>
#include <stdlib.h>
int
main()
{
pm_hdl_t hdl;
// attach to object with read-only access
hdl = pm_attach("object", O_RDONLY);
if (!pm_valid_hdl(hdl)) {
perror("pm_attach");
}
return EXIT_SUCCESS;
}
Neutrino
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
pm_attach()