📄 io_submit.1
字号:
.TH io_submit 2 2002-09-02 "Linux 2.4" "Linux AIO".SH NAMEio_submit \- submit io requests.SH SYNOPSIS.B #include <errno.h>.br.B #include <libaio.h>.LP.BI "int io_submit(io_context_t " ctx ", long " nr ", struct iocb *" iocbs "[]);".SH DESCRIPTION.B io_submitsubmits to the io_context.I ctxup to.I nrI/O requests pointed to by the vector.IR iocbs .The.B iocbstructure is defined as something like.sp.RS.nfstruct iocb { void *data;.\" unsigned key; short aio_lio_opcode; short aio_reqprio; int aio_fildes;};.fi.RE.sp.I datais a an opaque pointer which will upon completion be returned in the.B io_eventstructure by.BR io_getevents (2)..\" and io_wait(2)Callers will typically use this to point directly or indirectly to acallback function..sp.I aio_lio_opcodeis the I/O operation requested. Callers will typically set this and thearguments to the I/O operation calling the.BR io_prep_ (3)function corresponding to the operation..sp.I aio_reqpriois the priority of the request. Higher values have more priority; thenormal priority is 0..sp.I aio_fildesis the file descriptor for the I/O operation.Callers will typically set this and thearguments to the I/O operation calling the.BR io_prep_ *(3)function corresponding to the operation..spThe caller may not modify the contents or resubmit a submitted.B iocbstructure until after the operation completes or is canceled.The implementation of.BR io_submit (2)is permitted to modify reserved fields of the.B iocbstructure..SH "RETURN VALUES"If able to submit at least one iocb,.B io_submitreturns the number of iocbs submitted successfully. Otherwise, .RI - erroris returned, where .I erroris one of the Exxx values defined in the Errors section..SH ERRORS.TP.B EFAULT.I iocbsreferenced data outside of the program's accessible address space..TP.B EINVAL.I nris negative,.I ctxrefers to an uninitialized aio context, the iocb pointed to by .IR iocbs [0]is improperly initialized or specifies an unsupported operation..TP.B EBADFThe iocb pointed to by.IR iocbs [0]contains a file descriptor that does not exist..TP.B EAGAINInsufficient resources were available to queue any operations..SH "SEE ALSO".BR io_setup (2),.BR io_destroy (2),.BR io_getevents (2),.\".BR io_wait (2),.BR io_prep_pread (3),.BR io_prep_pwrite (3),.BR io_prep_fsync (3),.BR io_prep_fdsync (3),.BR io_prep_noop (3),.BR io_cancel (2),.BR errno (3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -