lwpSigWait() was designed to resemble sigwait(). It doesn't anymore.
Drop the awkward argument, and use the return value instead.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
int lwpSleepFd(int fd, int flags, struct timeval *timeout);
int lwpSleepUntil(time_t until);
void lwpWakeup(struct lwpProc *);
-int lwpSigWait(int *sig);
+int lwpSigWait(void);
void *lwpGetUD(struct lwpProc *);
void lwpSetUD(struct lwpProc *, char *ud);
int lwpSetPriority(int prio);
int
empth_wait_for_signal(void)
{
- int sig, err;
+ int sig;
time_t now;
ef_make_stale();
for (;;) {
- err = lwpSigWait(&sig);
- if (CANT_HAPPEN(err)) {
+ sig = lwpSigWait();
+ if (CANT_HAPPEN(sig < 0)) {
time(&now);
lwpSleepUntil(now + 60);
continue;
/*
* Wait until one of the signals passed to lwpInitSigWait() arrives.
- * Assign its number to *@sig and return 0.
- * If another thread is already waiting for signals, return EBUSY
+ * Return its signal number.
+ * If another thread is already waiting for signals, return -1
* without waiting.
*/
int
-lwpSigWait(int *sig)
+lwpSigWait(void)
{
int res;
if (LwpSigWaiter)
- return EBUSY;
+ return -1;
for (;;) {
res = lwpGetSig();
if (res > 0)
LwpSigWaiter = LwpCurrent;
lwpReschedule();
}
- *sig = res;
- return 0;
+ return res;
}
/*