summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/devname.3
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2002-03-18 02:32:53 +0000
committerdd <dd@FreeBSD.org>2002-03-18 02:32:53 +0000
commit15e2eac5f3f23d02b9ad823d3eb77cae67b96f8a (patch)
treee23ce9fce5e99f206814554ef44dbad0a642d9ba /lib/libc/gen/devname.3
parentac8c786c3b42bd76ea86cfe4b12dbb6544b4bb12 (diff)
downloadFreeBSD-src-15e2eac5f3f23d02b9ad823d3eb77cae67b96f8a.zip
FreeBSD-src-15e2eac5f3f23d02b9ad823d3eb77cae67b96f8a.tar.gz
Update to reflect reality; devname(3) hasn't returned NULL on failure
since revision 1.2 of devname.c (1999/07/18). While I'm here, note, in the BUGS section, that the returned pointer is to a static buffer.
Diffstat (limited to 'lib/libc/gen/devname.3')
-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