getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man9f / ldi_read.9f
blob50b2fc49ee45aca1f4d503acfec402ff1d28d5f6
1 '\" te
2 .\"  Copyright (c) 2003, Sun Microsystems, Inc.,  All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH LDI_READ 9F "Jun 3, 2003"
7 .SH NAME
8 ldi_read, ldi_write \- Read and write from a device
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunldi.h>
14 \fB\fR\fBint\fR ldi_read(\fBldi_handle_t\fR \fIlh\fR, \fBstruct uio *\fR\fIuiop\fR, \fBcred_t *\fR\fIcr\fR);
15 .fi
17 .LP
18 .nf
19 \fBint\fR \fB ldi_write\fR(\fBldi_handle_t\fR \fIlh\fR, \fBstruct uio *\fR\fIuiop\fR, \fBcred_t *\fR\fIcr\fR);
20 .fi
22 .SH PARAMETERS
23 .sp
24 .ne 2
25 .na
26 \fB\fIlh\fR \fR
27 .ad
28 .RS 9n
29 Layered handle.
30 .RE
32 .sp
33 .ne 2
34 .na
35 \fB\fIcr\fR \fR
36 .ad
37 .RS 9n
38 Pointer to a credential structure used to open a device.
39 .RE
41 .sp
42 .ne 2
43 .na
44 \fB\fIuiop\fR \fR
45 .ad
46 .RS 9n
47 Pointer to the \fBuio(9S)\fR structure. \fBuio(9S)\fR specifies  the location
48 of the read or write data.  (Either userland or kernel.)
49 .RE
51 .SH DESCRIPTION
52 .sp
53 .LP
54 The \fBldi_read()\fR function passes a read request to the device entry point
55 for the device specified by the layered handle. This operation is supported
56 for  block,  character, and streams devices.
57 .sp
58 .LP
59 The \fBldi_write()\fR function passes a write request to the device entry
60 point for a device specified by the layered handle. This operation is supported
61 for block,  character, and streams devices.
62 .SH RETURN VALUES
63 .sp
64 .LP
65 The \fBldi_read()\fR and \fBldi_write()\fR functions return \fB0\fR upon
66 success. If  a  failure occurs before the request is passed to the device, the
67 possible return values are shown below. Otherwise any other error number may be
68 returned by the device.
69 .sp
70 .ne 2
71 .na
72 \fBEINVAL\fR
73 .ad
74 .RS 11n
75 Invalid input parameters.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fBENOTSUP\fR
82 .ad
83 .RS 11n
84 Operation is not supported for this device.
85 .RE
87 .SH CONTEXT
88 .sp
89 .LP
90 These functions may be called from user or kernel context.