summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/devname.324
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/libc/gen/devname.3 b/lib/libc/gen/devname.3
index ccc60c5..6904a89 100644
--- a/lib/libc/gen/devname.3
+++ b/lib/libc/gen/devname.3
@@ -56,12 +56,19 @@ with a device number of
and a file type matching the one encoded in
.Fa type
which must be one of S_IFBLK or S_IFCHR.
-If no device matches the specified values, or no information is
-available, NULL is returned.
-.Pp
-The traditional display for applications when no device is
-found is the string
-.Dq ?? .
+To find the right name,
+.Fn devname
+first searches the device database created by
+.Xr dev_mkdb 8 ;
+if that fails, it asks the kernel via the
+.Va kern.devname
+sysctl.
+If it was still unable to come up with a suitable name,
+it will format the information encapsulated in
+.Fa dev
+and
+.Fa type
+in a human-readable format.
.Sh SEE ALSO
.Xr stat 2 ,
.Xr dev_mkdb 8
@@ -70,3 +77,8 @@ The
.Fn devname
function call appeared in
.Bx 4.4 .
+.Sh BUGS
+The
+.Fn devname
+function returns a poiner to an internal static object;
+thus, subsequent calls will modify the same buffer.
OpenPOWER on IntegriCloud