Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man3devinfo / di_devfs_path.3devinfo
blobf64cf152d8d4b69a1965a4cbef0cecc0fd4baac9
1 '\" te
2 .\" Copyright (c) 2008, 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 DI_DEVFS_PATH 3DEVINFO "May 15, 2008"
7 .SH NAME
8 di_devfs_path, di_devfs_minor_path, di_path_devfs_path,
9 di_path_client_devfs_path, di_devfs_path_free \- generate and free path names
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
14 #include <libdevinfo.h>
16 \fBchar *\fR\fBdi_devfs_path\fR(\fBdi_node_t\fR \fInode\fR);
17 .fi
19 .LP
20 .nf
21 \fBchar *\fR\fBdi_devfs_minor_path\fR(\fBdi_minor_t\fR \fIminor\fR);
22 .fi
24 .LP
25 .nf
26 \fBchar *\fR\fBdi_path_devfs_path\fR(\fBdi_path_t\fR \fIpath\fR);
27 .fi
29 .LP
30 .nf
31 \fBchar *\fR\fBdi_path_client_devfs_path\fR(\fBdi_path_t\fR \fIpath\fR);
32 .fi
34 .LP
35 .nf
36 \fBvoid\fR \fBdi_devfs_path_free\fR(\fBchar *\fR\fIpath_buf\fR);
37 .fi
39 .SH PARAMETERS
40 .sp
41 .ne 2
42 .na
43 \fB\fInode\fR\fR
44 .ad
45 .RS 12n
46 The handle to a device node in a \fBdi_init\fR(3DEVINFO) snapshot.
47 .RE
49 .sp
50 .ne 2
51 .na
52 \fB\fIminor\fR\fR
53 .ad
54 .RS 12n
55 The handle to a device minor node in a snapshot.
56 .RE
58 .sp
59 .ne 2
60 .na
61 \fB\fIpath\fR\fR
62 .ad
63 .RS 12n
64 The handle to a device path node in a snapshot.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fIpath_buf\fR\fR
71 .ad
72 .RS 12n
73 A pointer returned by \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR,
74 \fBdi_path_devfs_path()\fR, or \fBdi_path_client_devfs_path()\fR.
75 .RE
77 .SH DESCRIPTION
78 .sp
79 .LP
80 The \fBdi_devfs_path()\fR function generates the physical path of the device
81 node specified by \fInode\fR.
82 .sp
83 .LP
84 The \fBdi_devfs_minor_path()\fR function generates the physical path of the
85 device minor node specified by \fIminor\fR.
86 .sp
87 .LP
88 The \fBdi_path_devfs_path()\fR function generates the pHCI physical path to the
89 device associated with the specified path node. The returned string is
90 identical to the \fBdi_devfs_path()\fR  for the device had the device not been
91 supported by multipath.
92 .sp
93 .LP
94 The \fBdi_path_client_devfs_path()\fR function generates the vHCI physical path
95 of the multipath client device node associated with the device identity of the
96 specified path node. The returned string is identical to the
97 \fBdi_devfs_path()\fR of the multipath client device node.
98 .sp
99 .LP
100 The \fBdi_devfs_path_free()\fR function frees memory that was allocated to
101 store the path returned by \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR,
102 \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR. The caller
103 is responsible for freeing this memory by calling \fBdi_devfs_path_free()\fR.
104 .SH RETURN VALUES
107 Upon successful completion, the \fBdi_devfs_path()\fR,
108 \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, and
109 \fBdi_path_client_devfs_path()\fR functions return a pointer to the string
110 containing the path to a device node, a device minor node, or a device path
111 node, respectively. Otherwise, they return \fINULL\fR and \fBerrno\fR is set to
112 indicate the error. For a non-NULL return, the path will not have a
113 "/\fBdevices\fR" prefix.
114 .SH ERRORS
117 The \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR,
118 \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR functions
119 will fail if:
121 .ne 2
123 \fB\fBEINVAL\fR\fR
125 .RS 10n
126 The \fInode\fR, \fIminor\fR, or \fIpath\fR argument is not a valid handle.
131 The \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR,
132 \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR functions can
133 also return any error value returned by \fBmalloc\fR(3C).
134 .SH ATTRIBUTES
137 See \fBattributes\fR(5)  for descriptions of the following attributes:
142 box;
143 c | c
144 l | l .
145 ATTRIBUTE TYPE  ATTRIBUTE VALUE
147 Interface Stability     Committed
149 MT-Level        Safe
152 .SH SEE ALSO
155 \fBdi_init\fR(3DEVINFO), \fBlibdevinfo\fR(3LIB), \fBmalloc\fR(3C),
156 \fBattributes\fR(5)
159 \fIWriting Device Drivers\fR