📄 aio_suspend.3
字号:
.TH aio_suspend 3 2002-09-12 "Linux 2.4" Linux AIO".SH NAMEaio_suspend \- Wait until one or more requests of a specific set terminates..SH SYNOPSYS.nf.B "#include <errno.h>".sp.br .B "#include <aio.h>".sp.br.BI "int aio_suspend (const struct aiocb *const list[], int nent, const struct timespec *timeout)".fi.SH DESCRIPTIONAnother method of synchronization is to wait until one or more requests of aspecific set terminated. This could be achieved by the .IR "aio_*"functions to notify the initiating process about the termination but insome situations this is not the ideal solution. In a program whichconstantly updates clients somehow connected to the server it is notalways the best solution to go round robin since some connections mightbe slow. On the other hand letting the .IR "aio_*"function notify thecaller might also be not the best solution since whenever the processworks on preparing data for on client it makes no sense to beinterrupted by a notification since the new client will not be handledbefore the current client is served. For situations like this.IR "aio_suspend"should be used..PPWhen calling this function, the calling thread is suspended until atleast one of the requests pointed to by the .IR "nent"elements of thearray .IR "list"has completed. If any of the requests has alreadycompleted at the time .IR "aio_suspend"is called, the function returnsimmediately. Whether a request has terminated or not is determined bycomparing the error status of the request with .IR "EINPROGRESS". Ifan element of .IR "list"is .IR "NULL", the entry is simply ignored.If no request has finished, the calling process is suspended. If.IR "timeout"is .IR "NULL", the process is not woken until a requesthas finished. If .IR "timeout"is not .IR "NULL", the process remainssuspended at least as long as specified in .IR "timeout". In this case,.IR "aio_suspend"returns with an error..PPWhen the sources are compiled with .IR "_FILE_OFFSET_BITS == 64"thisfunction is in fact .IR "aio_suspend64"since the LFS interfacetransparently replaces the normal implementation..SH "RETURN VALUES"The return value of the function is .IR 0if one or more requestsfrom the .IR "list"have terminated. Otherwise the function returns.IR -1and .IR "errno"is set..SH ERRORS.TP.B EAGAINNone of the requests from the .IR "list"completed in the time specifiedby .IR "timeout"..TP.B EINTRA signal interrupted the .IR "aio_suspend"function. This signal mightalso be sent by the AIO implementation while signalling the terminationof one of the requests..TP.B ENOSYSThe .IR "aio_suspend"function is not implemented..SH "SEE ALSO".BR aio(3),.BR aio_cancel(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_suspend64(3),.BR aio_write(3),.BR aio_write64(3),.BR errno(3),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -