From b4de6f93aed733b8fc8d103e5ced69ebe7d659e6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 9 Sep 2011 01:07:38 -0400 Subject: implement POSIX asynchronous io some features are not yet supported, and only minimal testing has been performed. should be considered experimental at this point. --- src/aio/aio_cancel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/aio/aio_cancel.c (limited to 'src/aio/aio_cancel.c') diff --git a/src/aio/aio_cancel.c b/src/aio/aio_cancel.c new file mode 100644 index 00000000..5a753b1f --- /dev/null +++ b/src/aio/aio_cancel.c @@ -0,0 +1,16 @@ +#include +#include +#include + +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; +} -- cgit v1.2.1