Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
DEVNAME(3)		 BSD Library Functions Manual		    DEVNAME(3)

NAME
     devname --	get device name

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <sys/stat.h>
     #include <stdlib.h>

     char *
     devname(dev_t dev,	mode_t type);

     char *
     devname_r(dev_t dev, mode_t type, char *buf, int len);

DESCRIPTION
     The devname() function returns a pointer to the name of the block or
     character device in /dev with a device number of dev, and a file type
     matching the one encoded in type which must be one	of S_IFBLK or S_IFCHR.
     To	find the right name, devname() asks the	kernel via the kern.devname
     sysctl.  If it is unable to come up with a	suitable name, it will format
     the information encapsulated in dev and type in a human-readable format.

     devname() returns the name	stored in a static buffer which	will be	over-
     written on	subsequent calls.  devname_r() takes a buffer and length as
     argument to avoid this problem.

SEE ALSO
     stat(2)

HISTORY
     The devname() function appeared in	4.4BSD.

BSD				 July 18, 1999				   BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=devname&sektion=3&manpath=FreeBSD+5.3-RELEASE>

home | help