96
96
iphb_wait(iphb_t iphbh, unsigned short mintime, unsigned short maxtime, int must_wait);
100
Wait for the next heartbeat.
102
There can be only one wakeup / iphb handle. Calling this function cancels
103
any previously programmed wakeup. Using zero for both mintime and maxtime
104
can be used to cancel without programming a new wakeup.
106
If mintime == maxtime, a global wakeup slot is used rather than ranged
107
wakeup. To maximize changes of synchronous wakeups the predefined
108
IPHB_GS_WAIT_* values should be used.
110
@param iphbh Handle got from iphb_open
112
@param mintime Time in seconds that MUST be waited before heartbeat
115
@param maxtime Time in seconds when the wait SHOULD end. It is wise to
116
have maxtime-mintime quite big to maximize chances that
117
other iphb clients can be woken up in sync.
119
@param must_wait If non-zero, this functions waits for the wakeup before
120
returning. Zero value means you need to use select/poll
121
and wait for the socket to become readable. The file
122
descriptor to wait for can be queried via iphb_get_fd().
123
Once the socket comes readable, the incoming data must
124
be flushed - iphb_discard_wakeups can be used for this.
126
@param resume If nonzero, the device is woken from suspend to end the
127
wait period. Use zero value if the client process can
128
wait until the device gets out of suspend for some other
131
@return Time waited, (time_t)-1 if error (check errno)
134
iphb_wait2(iphb_t iphbh, unsigned mintime, unsigned maxtime, int must_wait,