AIO_CANCEL(3)              POSIX Programmer's Manual             AIO_CANCEL(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       aio_cancel -- cancel an asynchronous I/O request

SSYYNNOOPPSSIISS
       #include <aio.h>

       int aio_cancel(int _f_i_l_d_e_s, struct aiocb *_a_i_o_c_b_p);

DDEESSCCRRIIPPTTIIOONN
       The _a_i_o___c_a_n_c_e_l() function shall attempt to cancel one or more
       asynchronous I/O requests currently outstanding against file descriptor
       _f_i_l_d_e_s.  The _a_i_o_c_b_p argument points to the asynchronous I/O control
       block for a particular request to be canceled. If _a_i_o_c_b_p is NULL, then
       all outstanding cancelable asynchronous I/O requests against _f_i_l_d_e_s
       shall be canceled.

       Normal asynchronous notification shall occur for asynchronous I/O
       operations that are successfully canceled. If there are requests that
       cannot be canceled, then the normal asynchronous completion process
       shall take place for those requests when they are completed.

       For requested operations that are successfully canceled, the associated
       error status shall be set to [[EECCAANNCCEELLEEDD]] and the return status shall be
       -1. For requested operations that are not successfully canceled, the
       _a_i_o_c_b_p shall not be modified by _a_i_o___c_a_n_c_e_l().

       If _a_i_o_c_b_p is not NULL, then if _f_i_l_d_e_s does not have the same value as
       the file descriptor with which the asynchronous operation was
       initiated, unspecified results occur.

       Which operations are cancelable is implementation-defined.

RREETTUURRNN VVAALLUUEE
       The _a_i_o___c_a_n_c_e_l() function shall return the value AIO_CANCELED if the
       requested operation(s) were canceled.  The value AIO_NOTCANCELED shall
       be returned if at least one of the requested operation(s) cannot be
       canceled because it is in progress. In this case, the state of the
       other operations, if any, referenced in the call to _a_i_o___c_a_n_c_e_l() is not
       indicated by the return value of _a_i_o___c_a_n_c_e_l().  The application may
       determine the state of affairs for these operations by using
       _a_i_o___e_r_r_o_r().  The value AIO_ALLDONE is returned if all of the
       operations have already completed.  Otherwise, the function shall
       return -1 and set _e_r_r_n_o to indicate the error.

EERRRROORRSS
       The _a_i_o___c_a_n_c_e_l() function shall fail if:

       EEBBAADDFF  The _f_i_l_d_e_s argument is not a valid file descriptor.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _a_i_o___r_e_a_d(), _a_i_o___w_r_i_t_e()

       The Base Definitions volume of POSIX.1-2017, <<aaiioo..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                        AIO_CANCEL(3)
