~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/libaio/man/io_submit.1

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH io_submit 2 2002-09-02 "Linux 2.4" "Linux AIO"
 
2
.SH NAME
 
3
io_submit \- submit io requests
 
4
.SH SYNOPSIS
 
5
.B #include <errno.h>
 
6
.br
 
7
.B #include <libaio.h>
 
8
.LP
 
9
.BI "int io_submit(io_context_t " ctx ", long " nr ", struct iocb *" iocbs "[]);"
 
10
.SH DESCRIPTION
 
11
.B io_submit
 
12
submits to the io_context
 
13
.I ctx
 
14
up to
 
15
.I nr
 
16
I/O requests pointed to by the vector
 
17
.IR iocbs .
 
18
 
 
19
The
 
20
.B iocb
 
21
structure is defined as something like
 
22
.sp
 
23
.RS
 
24
.nf
 
25
struct iocb {
 
26
    void    *data;
 
27
.\"    unsigned    key;
 
28
    short    aio_lio_opcode;
 
29
    short    aio_reqprio;
 
30
    int      aio_fildes;
 
31
};
 
32
.fi
 
33
.RE
 
34
.sp
 
35
.I data
 
36
is a an opaque pointer which will upon completion be returned in the
 
37
.B io_event
 
38
structure by
 
39
.BR io_getevents (2).
 
40
.\" and io_wait(2)
 
41
Callers will typically use this to point directly or indirectly to a
 
42
callback function.
 
43
.sp
 
44
.I aio_lio_opcode
 
45
is the I/O operation requested.  Callers will typically set this and the
 
46
arguments to the I/O operation calling the
 
47
.BR io_prep_ (3)
 
48
function corresponding to the operation.
 
49
.sp
 
50
.I aio_reqprio
 
51
is the priority of the request.  Higher values have more priority; the
 
52
normal priority is 0.
 
53
.sp
 
54
.I aio_fildes
 
55
is the file descriptor for the I/O operation.
 
56
Callers will typically set this and the
 
57
arguments to the I/O operation calling the
 
58
.BR io_prep_ *(3)
 
59
function corresponding to the operation.
 
60
.sp
 
61
The caller may not modify the contents or resubmit a submitted
 
62
.B iocb
 
63
structure until after the operation completes or is canceled.
 
64
The implementation of
 
65
.BR io_submit (2)
 
66
is permitted to modify reserved fields of the
 
67
.B iocb
 
68
structure.
 
69
.SH "RETURN VALUES"
 
70
If able to submit at least one iocb,
 
71
.B io_submit
 
72
returns the number of iocbs submitted successfully.  Otherwise, 
 
73
.RI - error
 
74
is returned, where 
 
75
.I error
 
76
is one of the Exxx values defined in the Errors section.
 
77
.SH ERRORS
 
78
.TP
 
79
.B EFAULT
 
80
.I iocbs
 
81
referenced data outside of the program's accessible address space.
 
82
.TP
 
83
.B EINVAL
 
84
.I nr
 
85
is negative,
 
86
.I ctx
 
87
refers to an uninitialized aio context, the iocb pointed to by 
 
88
.IR iocbs [0]
 
89
is improperly initialized or specifies an unsupported operation.
 
90
.TP
 
91
.B EBADF
 
92
The iocb pointed to by
 
93
.IR iocbs [0]
 
94
contains a file descriptor that does not exist.
 
95
.TP
 
96
.B EAGAIN
 
97
Insufficient resources were available to queue any operations.
 
98
.SH "SEE ALSO"
 
99
.BR io_setup (2),
 
100
.BR io_destroy (2),
 
101
.BR io_getevents (2),
 
102
.\".BR io_wait (2),
 
103
.BR io_prep_pread (3),
 
104
.BR io_prep_pwrite (3),
 
105
.BR io_prep_fsync (3),
 
106
.BR io_prep_fdsync (3),
 
107
.BR io_prep_noop (3),
 
108
.BR io_cancel (2),
 
109
.BR errno (3)