82 lines
1.8 KiB
Groff
82 lines
1.8 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g2.fdes_to_devname @(#)fdes_to_devname 1.1 of 4/10/97
|
|
.TH FDES_TO_DEVNAME 2
|
|
.SH NAME
|
|
fdes_to_devname \- determine the device name for the device
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
.PP
|
|
.sp
|
|
.nf
|
|
.B #include <invent.h>
|
|
.sp
|
|
.B "char * fdes_to_devname (int fd, char \(**buf, int \(**length);"
|
|
.PP
|
|
.Op
|
|
.SH OVERVIEW
|
|
.I fdes_to_devname
|
|
is useful to determine the canonical hardware graph path name
|
|
given the a device file descriptor. Note that this file
|
|
descriptor can correspond to any of the different alias names for
|
|
the device.
|
|
.SH DESCRIPTION
|
|
The
|
|
.I fdes_to_devname
|
|
function provides a way to retrieve the path name for a
|
|
device.
|
|
.P
|
|
.I fd\^
|
|
identifies the device,
|
|
.I buf\^
|
|
is the placeholder for the device name and
|
|
.I length
|
|
is an input/output argument that on the call to
|
|
.I fdes_to_devname
|
|
should contain the maximum size of the name the process is
|
|
willing to accept.
|
|
On return, the
|
|
.I length
|
|
will have been modified to show the actual size of the
|
|
device name returned.
|
|
.PP
|
|
.I fdes_to_devname
|
|
will fail if one or more of the following are true:
|
|
.TP
|
|
.SM
|
|
\%[E2BIG]
|
|
The device name is too large to fit into the buffer.
|
|
The integer that the
|
|
.I valuelength
|
|
argument points to has been modified to show the actual numnber
|
|
of bytes that would be required to store the value of that attribute.
|
|
.TP
|
|
.SM
|
|
\%[EBADF]
|
|
.I Fd\^
|
|
does not refer to a valid descriptor.
|
|
.TP
|
|
.SM
|
|
\%[EPERM]
|
|
The effective user
|
|
.SM ID
|
|
does not match the owner of the file
|
|
and the effective user
|
|
.SM ID
|
|
is not super-user.
|
|
.TP
|
|
.SM
|
|
\%[EFAULT]
|
|
.I Buf,
|
|
or
|
|
.I length
|
|
points outside the allocated address space of the process.
|
|
.SH "SEE ALSO"
|
|
attr(1), hwgraph(4)
|
|
.SH "DIAGNOSTICS"
|
|
Upon successful completion, the name is returned.
|
|
Otherwise, a value of NULL is returned and
|
|
.I errno\^
|
|
is set to indicate the error.
|
|
.\" @(#)fdes_to_devname.2 1.0 of 6.12.95
|
|
.Ee
|