*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> devname (3)              
Title
Content
Arch
Section
 

DEVNAME(3)

Contents


NAME    [Toc]    [Back]

     devname -- get device name

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #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    [Toc]    [Back]

     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 overwritten
 on subsequent calls.  devname_r() takes a buffer and length as
     argument to avoid this problem.

SEE ALSO    [Toc]    [Back]

      
      
     stat(2)

HISTORY    [Toc]    [Back]

     The devname() function appeared in 4.4BSD.


FreeBSD 5.2.1			 July 18, 1999			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
autochanger HP-UX SCSI interfaces for medium changer device and magnetooptical autochanger surface device
devctl FreeBSD device event reporting and device control interface
device_add_child_ordered FreeBSD add a new device as a child of an existing device
filename_to_devname IRIX determine the device name for the device file
filename_to_drivername IRIX determine the device name for the device file
device_add_child FreeBSD add a new device as a child of an existing device
dev_to_devname IRIX determine the device name for the device
fdes_to_devname IRIX determine the device name for the device
zero FreeBSD the zero device
devnm IRIX device name
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service