1ldi_read(9F)             Kernel Functions for Drivers             ldi_read(9F)
2
3
4

NAME

6       ldi_read, ldi_write - Read and write from a device
7

SYNOPSIS

9       #include <sys/sunldi.h>
10
11       int ldi_read(ldi_handle_t lh, struct uio *uiop, cred_t *cr);
12
13
14       int  ldi_write(ldi_handle_t lh, struct uio *uiop, cred_t *cr);
15
16

PARAMETERS

18       lh       Layered handle.
19
20
21       cr       Pointer to a credential structure used to open a device.
22
23
24       uiop     Pointer to the uio(9S) structure. uio(9S) specifies  the loca‐
25                tion of the read or write data.  (Either userland or kernel.)
26
27

DESCRIPTION

29       The ldi_read() function passes a read request to the device entry point
30       for  the device specified by the layered handle. This operation is sup‐
31       ported  for  block,  character, and streams devices.
32
33
34       The ldi_write() function passes a write request  to  the  device  entry
35       point  for  a device specified by the layered handle. This operation is
36       supported for block,  character, and streams devices.
37

RETURN VALUES

39       The ldi_read() and ldi_write() functions return 0 upon success.  If   a
40       failure occurs before the request is passed to the device, the possible
41       return values are shown below. Otherwise any other error number may  be
42       returned by the device.
43
44       EINVAL     Invalid input parameters.
45
46
47       ENOTSUP    Operation is not supported for this device.
48
49

CONTEXT

51       These functions may be called from user or kernel context.
52
53
54
55SunOS 5.11                        3 June 2003                     ldi_read(9F)
Impressum