xref: /original-bsd/lib/libc/gen/devname.3 (revision 0842ddeb)
1.\" Copyright (c) 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)devname.3	8.2 (Berkeley) 04/29/95
7.\"
8.Dd
9.Dt DEVNAME 3
10.Os BSD 4.4
11.Sh NAME
12.Nm devname
13.Nd get device name
14.Sh SYNOPSIS
15.Fd #include <stdlib.h>
16.Ft char *
17.Fn devname "dev_t dev" "mode_t type"
18.Sh DESCRIPTION
19The
20.Fn devname
21function returns a pointer to the name of the block or character
22device in
23.Dq Pa /dev
24with a device number of
25.Fa dev ,
26and a file type matching the one encoded in
27.Fa type
28which must be one of S_IFBLK or S_IFCHR.
29If no device matches the specified values, or no information is
30available, NULL is returned.
31.Pp
32The traditional display for applications when no device is
33found is the string
34.Dq ?? .
35.Sh SEE ALSO
36.Xr stat 2 ,
37.Xr dev_mkdb 8
38.Sh HISTORY
39The
40.Nm devname
41function call appeared in
42.Bx 4.4 .
43