projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in clock_getres, check for null pointer before storing result
[musl]
/
src
/
aio
/
aio_suspend.c
diff --git
a/src/aio/aio_suspend.c
b/src/aio/aio_suspend.c
index
dfa524b
..
9b24b6a
100644
(file)
--- a/
src/aio/aio_suspend.c
+++ b/
src/aio/aio_suspend.c
@@
-2,11
+2,8
@@
#include <errno.h>
#include <time.h>
#include "atomic.h"
#include <errno.h>
#include <time.h>
#include "atomic.h"
-#include "libc.h"
#include "pthread_impl.h"
#include "pthread_impl.h"
-extern volatile int __aio_fut;
-
int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec *ts)
{
int i, tid = 0, ret, expect = 0;
int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec *ts)
{
int i, tid = 0, ret, expect = 0;
@@
-15,6
+12,8
@@
int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
int nzcnt = 0;
const struct aiocb *cb = 0;
int nzcnt = 0;
const struct aiocb *cb = 0;
+ pthread_testcancel();
+
if (cnt<0) {
errno = EINVAL;
return -1;
if (cnt<0) {
errno = EINVAL;
return -1;
@@
-61,13
+60,17
@@
int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec
break;
}
break;
}
- ret = __timedwait(pfut, expect, CLOCK_MONOTONIC, ts?&at:0, 1);
+ ret = __timedwait
_cp
(pfut, expect, CLOCK_MONOTONIC, ts?&at:0, 1);
- if (ret) {
- errno = ret==ETIMEDOUT ? EAGAIN : ret;
+ switch (ret) {
+ case ETIMEDOUT:
+ ret = EAGAIN;
+ case ECANCELED:
+ case EINTR:
+ errno = ret;
return -1;
}
}
}
return -1;
}
}
}
-
LFS64(aio_suspend
);
+
weak_alias(aio_suspend, aio_suspend64
);