rework langinfo code for ABI compat and for use by time code
[musl] / src / aio / aio_cancel.c
1 #include <aio.h>
2 #include <pthread.h>
3 #include <errno.h>
4
5 int aio_cancel(int fd, struct aiocb *cb)
6 {
7         if (!cb) {
8                 /* FIXME: for correctness, we should return AIO_ALLDONE
9                  * if there are no outstanding aio operations on this
10                  * file descriptor, but that would require making aio
11                  * much slower, and seems to have little advantage since
12                  * we don't support cancellation anyway. */
13                 return AIO_NOTCANCELED;
14         }
15         return cb->__err==EINPROGRESS ? AIO_NOTCANCELED : AIO_ALLDONE;
16 }