[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    aio_cancel(3R) manual page Table of Contents

Name

aio_cancel - cancel asynchronous I/O request

Synopsis

cc [ flag ... ] file ... -lposix4 [ library ... ]

#include <aio.h>

int aio_cancel(int fildes, struct aiocb *aiocbp);

MT-Level

MT-Safe

Description

aio_cancel() attempts to cancel either one or all outstanding asynchronous I/O requests pending on the file descriptor specified by fildes. If aiocbp is NULL, then all such outstanding cancelable requests are canceled; otherwise, the individual request referenced by aiocbp references will be canceled.

Normal completion notification occurs even for asynchronous I/O operations that are successfully canceled. If there are requests which cannot be canceled, then the normal asynchronous completion process takes place for those requests, and their associated aiocb structures are not modified.

struct aiocb {
intaio_fildes;/* file descriptor */
volatile void*aio_buf;/* buffer location */
size_taio_nbytes;/* length of transfer */
off_taio_offset;/* file offset */
intaio_reqprio;/* request priority offset */
struct sigeventaio_sigevent;/* signal number and offset */
intaio_lio_opcode;/* listio operation */
};

struct sigevent {
intsigev_notify;/* notification mode */
intsigev_signo;/* signal number */
union sigvalsigev_value;/* signal value */
};

union sigval {
intsival_int;/* integer value */
void*sival_ptr;/* pointer value */
};

Return Values

If the requested operation(s) were canceled, aio_cancel() returns AIO_CANCELED. But if at least one of the requested operation(s) cannot be canceled because it is in progress, then AIO_NOTCANCELED is returned, and the application may determine the state of affairs for these operation(s) by using aio_error(3R) . If all of the operation(s) had already completed, AIO_ALLDONE is returned. Otherwise, aio_cancel() returns -1, and sets errno to indicate the error condition.

Errors

EBADF
fildes is not a valid file descriptor.
ENOSYS
aio_cancel() is not supported by this implementation.

See Also

aio_return(3R) , aio_read(3R)

Notes

Applications compiled under Solaris 2.3 and 2.4 and using POSIX aio must be recompiled to work correctly when Solaris supports the Asynchronous Input and Output option.

Bugs

In Solaris 2.5, these functions always return -1 and set errno to ENOSYS, because this release does not support the Asynchronous Input and Output option. It is our intention to provide support for these interfaces in future releases.


Table of Contents