summaryrefslogtreecommitdiff
path: root/src/aio/aio_cancel.c
blob: 5a753b1f42f6b8a1ac4dddf12b30411ca89dd9c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <aio.h>
#include <pthread.h>
#include <errno.h>

int aio_cancel(int fd, struct aiocb *cb)
{
	if (!cb) {
		/* FIXME: for correctness, we should return AIO_ALLDONE
		 * if there are no outstanding aio operations on this
		 * file descriptor, but that would require making aio
		 * much slower, and seems to have little advantage since
		 * we don't support cancellation anyway. */
		return AIO_NOTCANCELED;
	}
	return cb->__err==EINPROGRESS ? AIO_NOTCANCELED : AIO_ALLDONE;
}