2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH AWRITE 9E "Mar 28, 1997"
9 awrite \- asynchronous write to a device
14 #include <sys/aio_req.h>
17 #include <sys/sunddi.h>
19 \fBintprefix\fR\fBawrite\fR(\fBdev_t\fR \fIdev\fR, \fBstruct aio_req *\fR\fIaio_reqp\fR,
20 \fBcred_t *\fR\fIcred_p\fR);
26 Solaris \fBDDI \fRspecific (Solaris DDI). This entry point is optional. Drivers
27 that do not support an \fBawrite()\fR entry point should use \fBnodev\fR(9F)
44 Pointer to the \fBaio_req\fR(9S) structure that describes where the data is
54 Pointer to the credential structure.
60 The driver's \fBawrite()\fR routine is called to perform an asynchronous write.
61 \fBgetminor\fR(9F) can be used to access the minor number component of the
62 \fIdev\fR argument. \fBawrite()\fR may use the credential structure pointed to
63 by \fIcred_p\fR to check for superuser access by calling \fBdrv_priv\fR(9F).
64 The \fBawrite()\fR routine may also examine the \fBuio\fR(9S) structure
65 through the \fBaio_req\fR structure pointer, \fBaio_reqp\fR. \fBawrite()\fR
66 must call \fBaphysio\fR(9F) with the \fBaio_req\fR pointer and a pointer to the
67 driver's \fBstrategy\fR(9E) routine.
70 No fields of the \fBuio\fR(9S) structure pointed to by \fBaio_req\fR, other
71 than \fBuio_offset\fR or \fBuio_loffset\fR, may be modified for non-seekable
76 The \fBawrite()\fR routine should return \fB0\fR for success, or the
77 appropriate error number.
81 This function is called from user context only.
84 \fBExample 1 \fRUsing the \fBawrite()\fR routine:
87 The following is an example of an \fBawrite()\fR routine:
93 xxawrite(dev_t dev, struct aio_req *aio, cred_t *cred_p)
98 instance = getminor(dev);
99 xsp = ddi_get_soft_state(statep, instance);
100 /*Verify soft state structure has been allocated */
103 return (aphysio(xxstrategy, anocancel, dev, B_WRITE, \e
112 \fBwrite\fR(2), \fBaiowrite\fR(3C), \fBaread\fR(9E), \fBread\fR(9E),
113 \fBstrategy\fR(9E), \fBwrite\fR(9E), \fBanocancel\fR(9F), \fBaphysio\fR(9F),
114 \fBddi_get_soft_state\fR(9F), \fBdrv_priv\fR(9F), \fBgetminor\fR(9F),
115 \fBminphys\fR(9F), \fBnodev\fR(9F), \fBaio_req\fR(9S), \fBcb_ops\fR(9S),
119 \fIWriting Device Drivers\fR
123 There is no way other than calling \fBaphysio\fR(9F) to accomplish an