📄 aio_cancel.3
字号:
.TH aio_cancel 3 2002-09-12 "Linux 2.4" Linux AIO".SH NAMEaio_cancel - Cancel asynchronous I/O requests.SH SYNOPSYS.nf.B #include <errno.h>.sp.br .B #include <aio.h>.sp.br.BI "int aio_cancel (int fildes " , struct aiocb *aiocbp " )".fi.SH DESCRIPTIONWhen one or more requests are asynchronously processed, it might beuseful in some situations to cancel a selected operation, e.g., if itbecomes obvious that the written data is no longer accurate and wouldhave to be overwritten soon. As an example, assume an application, whichwrites data in files in a situation where new incoming data would haveto be written in a file which will be updated by an enqueued request.The POSIX AIO implementation provides such a function, but this functionis not capable of forcing the cancellation of the request. It is up to theimplementation to decide whether it is possible to cancel the operationor not. Therefore using this function is merely a hint..B "The libaio implementation does not implement the cancel operation in the".B "POSIX libraries"..PPThe .IR aio_cancelfunction can be used to cancel one or moreoutstanding requests. If the .IR aiocbp parameter is .IR NULL, thefunction tries to cancel all of the outstanding requests which would processthe file descriptor .IR fildes (i.e., whose .IR aio_fildes memberis .IR fildes). If .IR aiocbp is not .IR NULL,.IR aio_cancelattempts to cancel the specific request pointed to by .IR aiocbp.For requests which were successfully canceled, the normal notificationabout the termination of the request should take place. I.e., dependingon the .IR "struct sigevent" object which controls this, nothinghappens, a signal is sent or a thread is started. If the request cannotbe canceled, it terminates the usual way after performing the operation.After a request is successfully canceled, a call to .IR aio_errorwitha reference to this request as the parameter will return.B ECANCELEDand a call to .IR aio_returnwill return .IR -1.If the request wasn't canceled and is still running the error status isstill .B EINPROGRESS.When the sources are compiled with .IR "_FILE_OFFSET_BITS == 64", thisfunction is in fact .IR aio_cancel64since the LFS interfacetransparently replaces the normal implementation..SH "RETURN VALUES".TP.B AIO_CANCELEDIf there wererequests which haven't terminated and which were successfully canceled..TP.B AIO_NOTCANCELEDIf there is one or more requests left which couldn't be canceled,. In this case.IR aio_errormust be used to find out which of the, perhaps multiple, requests (in.IR aiocbpis .IR NULL) weren't successfully canceled. .TP.B AIO_ALLDONEIf allrequests already terminated at the time .IR aio_cancel is called thereturn value is ..SH ERRORSIf an error occurred during the execution of .IR aio_cancel thefunction returns .IR -1and sets .IR errnoto one of the followingvalues..TP.B EBADFThe file descriptor .IR fildesis not valid..TP.B ENOSYS.IR aio_cancelis not implemented..SH "SEE ALSO".BR aio(3),.BR aio_cancel64(3),.BR aio_error(3),.BR aio_error64(3),.BR aio_fsync(3),.BR aio_fsync64(3),.BR aio_init(3),.BR aio_read(3),.BR aio_read64(3),.BR aio_return(3),.BR aio_return64(3),.BR aio_suspend(3),.BR aio_suspend64(3),.BR aio_write(3),.BR aio_write64(3),.BR errno(3),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -