Current File : //usr/share/man/man3devinfo/di_devfs_path.3devinfo
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
.TH di_devfs_path 3DEVINFO "15 May 2008" "SunOS 5.11" "Device Information Library Functions"
.SH NAME
di_devfs_path, di_devfs_minor_path, di_path_devfs_path, di_path_client_devfs_path, di_devfs_path_free \- generate and free path names
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
#include <libdevinfo.h>

\fBchar *\fR\fBdi_devfs_path\fR(\fBdi_node_t\fR \fInode\fR);
.fi

.LP
.nf
\fBchar *\fR\fBdi_devfs_minor_path\fR(\fBdi_minor_t\fR \fIminor\fR);
.fi

.LP
.nf
\fBchar *\fR\fBdi_path_devfs_path\fR(\fBdi_path_t\fR \fIpath\fR);
.fi

.LP
.nf
\fBchar *\fR\fBdi_path_client_devfs_path\fR(\fBdi_path_t\fR \fIpath\fR);
.fi

.LP
.nf
\fBvoid\fR \fBdi_devfs_path_free\fR(\fBchar *\fR\fIpath_buf\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fInode\fR\fR
.ad
.RS 12n
.rt  
The handle to a device node in a \fBdi_init\fR(3DEVINFO) snapshot.
.RE

.sp
.ne 2
.mk
.na
\fB\fIminor\fR\fR
.ad
.RS 12n
.rt  
The handle to a device minor node in a snapshot.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpath\fR\fR
.ad
.RS 12n
.rt  
The handle to a device path node in a snapshot.
.RE

.sp
.ne 2
.mk
.na
\fB\fIpath_buf\fR\fR
.ad
.RS 12n
.rt  
A pointer returned by \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, or \fBdi_path_client_devfs_path()\fR.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBdi_devfs_path()\fR function generates the physical path of the device node specified by \fInode\fR.
.sp
.LP
The \fBdi_devfs_minor_path()\fR function generates the physical path of the device minor node specified by \fIminor\fR.
.sp
.LP
The \fBdi_path_devfs_path()\fR function generates the pHCI physical path to the device associated with the specified path node. The returned string is identical to the \fBdi_devfs_path()\fR  for the device had the device not been supported by multipath.
.sp
.LP
The \fBdi_path_client_devfs_path()\fR function generates the vHCI physical path of the multipath client device node associated with the device identity of the specified path node. The returned string is identical to the \fBdi_devfs_path()\fR of the multipath client device node.
.sp
.LP
The \fBdi_devfs_path_free()\fR function frees memory that was allocated to store the path returned by \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR. The caller is responsible for freeing this memory by calling \fBdi_devfs_path_free()\fR.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, the \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR functions return a pointer to the string containing the path to a device node, a device minor node, or a device path node, respectively. Otherwise, they return \fINULL\fR and \fBerrno\fR is set to indicate the error. For a non-NULL return, the path will not have a "/\fBdevices\fR" prefix.
.SH ERRORS
.sp
.LP
The \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR functions will fail if:
.sp
.ne 2
.mk
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
.rt  
The \fInode\fR, \fIminor\fR, or \fIpath\fR argument is not a valid handle.
.RE

.sp
.LP
The \fBdi_devfs_path()\fR, \fBdi_devfs_minor_path()\fR, \fBdi_path_devfs_path()\fR, and \fBdi_path_client_devfs_path()\fR functions can also return any error value returned by \fBmalloc\fR(3C).
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5)  for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelSafe
.TE

.SH SEE ALSO
.sp
.LP
\fBdi_init\fR(3DEVINFO), \fBlibdevinfo\fR(3LIB), \fBmalloc\fR(3C), \fBattributes\fR(5)
.sp
.LP
\fIWriting Device Drivers for Oracle Solaris 11.2\fR