xref: /original-bsd/lib/libc/gen/devname.3 (revision aed772c4)
1bac379f5Sbostic.\" Copyright (c) 1993
2bac379f5Sbostic.\"	The Regents of the University of California.  All rights reserved.
35a2cecccSmckusick.\"
45a2cecccSmckusick.\" %sccs.include.redist.man%
55a2cecccSmckusick.\"
6*aed772c4Sbostic.\"     @(#)devname.3	8.2 (Berkeley) 04/29/95
75a2cecccSmckusick.\"
85a2cecccSmckusick.Dd
95a2cecccSmckusick.Dt DEVNAME 3
105a2cecccSmckusick.Os BSD 4.4
115a2cecccSmckusick.Sh NAME
125a2cecccSmckusick.Nm devname
135a2cecccSmckusick.Nd get device name
145a2cecccSmckusick.Sh SYNOPSIS
155a2cecccSmckusick.Fd #include <stdlib.h>
165a2cecccSmckusick.Ft char *
175a2cecccSmckusick.Fn devname "dev_t dev" "mode_t type"
185a2cecccSmckusick.Sh DESCRIPTION
195a2cecccSmckusickThe
205a2cecccSmckusick.Fn devname
215a2cecccSmckusickfunction returns a pointer to the name of the block or character
225a2cecccSmckusickdevice in
235a2cecccSmckusick.Dq Pa /dev
245a2cecccSmckusickwith a device number of
255a2cecccSmckusick.Fa dev ,
265a2cecccSmckusickand a file type matching the one encoded in
275a2cecccSmckusick.Fa type
285a2cecccSmckusickwhich must be one of S_IFBLK or S_IFCHR.
295a2cecccSmckusickIf no device matches the specified values, or no information is
30*aed772c4Sbosticavailable, NULL is returned.
31*aed772c4Sbostic.Pp
32*aed772c4SbosticThe traditional display for applications when no device is
33*aed772c4Sbosticfound is the string
34*aed772c4Sbostic.Dq ?? .
355a2cecccSmckusick.Sh SEE ALSO
365a2cecccSmckusick.Xr stat 2 ,
375a2cecccSmckusick.Xr dev_mkdb 8
385a2cecccSmckusick.Sh HISTORY
395a2cecccSmckusickThe
405a2cecccSmckusick.Nm devname
415a2cecccSmckusickfunction call appeared in
425a2cecccSmckusick.Bx 4.4 .
43