~ubuntu-branches/ubuntu/saucy/manpages/saucy

« back to all changes in this revision

Viewing changes to man3/aio_write.3

  • Committer: Package Import Robot
  • Author(s): Loïc Minier
  • Date: 2011-10-17 13:06:22 UTC
  • mfrom: (1.1.46 upstream) (2.2.11 sid)
  • Revision ID: package-import@ubuntu.com-20111017130622-rbdw3julnma2baqu
Tags: 3.32-0.2ubuntu1
* Merge from Debian testing/unstable; remaining changes:
  - ptrace.2, prctl.2: document Ubuntu-specific PTRACE_ATTACH,
    PR_SET_PTRACER behavior.
* Keep Debian's glibc-doc version in the Replaces as it's satisfactory for
  upgrades from natty and lucid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21
21
.\" USA.
22
22
.\"
23
 
.TH AIO_WRITE 3 2003-11-14  "" "Linux Programmer's Manual"
 
23
.TH AIO_WRITE 3 2010-10-02  "" "Linux Programmer's Manual"
24
24
.SH NAME
25
25
aio_write \- asynchronous write
26
26
.SH SYNOPSIS
32
32
.SH DESCRIPTION
33
33
The
34
34
.BR aio_write ()
35
 
function requests an asynchronous "n = write(fd, buf, count)"
36
 
with fd, buf, count given by
37
 
.IR aiocbp\->aio_fildes ,
38
 
.IR aiocbp\->aio_buf ,
39
 
.IR aiocbp\->aio_nbytes ,
40
 
respectively.
41
 
The return status n can be retrieved upon completion using
42
 
.BR aio_return (3).
 
35
function queues the I/O request described by the buffer pointed to by
 
36
.IR aiocb .
 
37
This function is the asynchronous analog of
 
38
.BR write (2).
 
39
The arguments of the call
 
40
 
 
41
    write(fd, buf, count)
 
42
 
 
43
correspond (in order) to the fields
 
44
.IR aio_fildes ,
 
45
.IR aio_buf ,
 
46
and
 
47
.IR aio_nbytes
 
48
of the structure pointed to by
 
49
.IR aiocbp .
 
50
(See
 
51
.BR aio (7)
 
52
for a description of the
 
53
.I aiocb
 
54
structure.)
43
55
.LP
44
56
If
45
57
.B O_APPEND
46
58
is not set, the data is written starting at the
47
59
absolute file offset
48
60
.IR aiocbp\->aio_offset ,
49
 
regardless of the current file position.
 
61
regardless of the current file offset.
50
62
If
51
63
.B O_APPEND
52
 
is set, the data is written at the end of the file.
53
 
After this request, the value of the current file position is unspecified.
 
64
is set, data is written at the end of the file in the same order as
 
65
.BR aio_write ()
 
66
calls are made.
 
67
After the call, the value of the current file offset is unspecified.
54
68
.LP
55
69
The "asynchronous" means that this call returns as soon as the
56
70
request has been enqueued; the write may or may not have completed
57
71
when the call returns.
58
72
One tests for completion using
59
73
.BR aio_error (3).
 
74
The return status of a completed I/O operation can be obtained
 
75
.BR aio_return (3).
 
76
Asynchronous notification of I/O completion can be obtained by setting
 
77
.IR aiocbp\->aio_sigevent
 
78
appropriately; see
 
79
.BR sigevent (7)
 
80
for details.
60
81
.LP
61
82
If
62
83
.B _POSIX_PRIORITIZED_IO
76
97
is returned, and
77
98
.I errno
78
99
is set appropriately.
79
 
If an error is first detected later, it will
 
100
If an error is only detected later, it will
80
101
be reported via
81
102
.BR aio_return (3)
82
103
(returns status \-1) and
107
128
.TP
108
129
.B ENOSYS
109
130
This function is not supported.
 
131
.SH VERSIONS
 
132
The
 
133
.BR aio_write ()
 
134
function is available since glibc 2.1.
110
135
.SH "CONFORMING TO"
111
 
POSIX.1-2001.
 
136
POSIX.1-2001, POSIX.1-2008.
112
137
.SH NOTES
113
138
It is a good idea to zero out the control block before use.
114
 
This control block must not be changed while the write operation
 
139
The control block must not be changed while the write operation
115
140
is in progress.
116
141
The buffer area being written out
117
142
.\" or the control block of the operation
118
 
must not be accessed during the operation or undefined results may
119
 
occur.
 
143
must not be accessed during the operation or undefined results may occur.
120
144
The memory areas involved must remain valid.
 
145
 
 
146
Simultaneous I/O operations specifying the same
 
147
.I aiocb
 
148
structure produce undefined results.
121
149
.SH "SEE ALSO"
122
150
.BR aio_cancel (3),
123
151
.BR aio_error (3),
124
152
.BR aio_fsync (3),
125
153
.BR aio_read (3),
126
154
.BR aio_return (3),
127
 
.BR aio_suspend (3)
 
155
.BR aio_suspend (3),
 
156
.BR lio_listio (3),
 
157
.BR aio (7)
128
158
.SH COLOPHON
129
 
This page is part of release 3.27 of the Linux
 
159
This page is part of release 3.32 of the Linux
130
160
.I man-pages
131
161
project.
132
162
A description of the project,