DEVNAME(3) BSD Library Functions Manual DEVNAME(3)NAME
devname -- get device name
Standard C Library (libc, -lc)
devname(dev_t dev, mode_t type);
devname_r(dev_t dev, mode_t type, char *buf, int len);
fdevname_r(int fd, char *buf, int len);
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
The fdevname() and fdevname_r() function obtains the device name directly from a file descriptor pointing to a character device. If it is
unable to come up with a suitable name, these functions will return a NULL pointer.
devname() and fdevname() return the name stored in a static buffer which will be overwritten on subsequent calls. devname_r() and
fdevname_r() take a buffer and length as argument to avoid this problem.
struct stat buf;
fd = open("/dev/tun");
printf("devname is /dev/%s
", devname(buf.st_rdev, S_IFCHR));
printf("fdevname is /dev/%s
SEE ALSO stat(2)HISTORY
The devname() function appeared in 4.4BSD. The fdevname() function appeared in FreeBSD 8.0.
BSD February 22, 2005 BSD
Check Out this Related Man Page
DEV_MKDB(8) BSD System Manager's Manual DEV_MKDB(8)NAME
dev_mkdb -- create /dev database
dev_mkdb [-c] [-o database] [directory]
The dev_mkdb command creates a cdbr(3) database in ``/var/run/dev.cdb'' which contains the names of all of the character and block special
files in the specified directory, using the file type and the st_rdev field as the key. If no directory is specified, the ``/dev'' directory
Keys are a structure containing a mode_t followed by a dev_t, with any padding zero'd out. The former is the type of the file (st_mode &
S_IFMT), the latter is the st_rdev field.
The options are as follows:
-c Create a db(3) database for compatibility with libc versions and statically linked programs from before NetBSD 6.0. The default name
Put the output databases in the named file.
/dev Device directory.
/var/run/dev.db Database file.
SEE ALSO ps(1), stat(2), db(3), devname(3), kvm_nlist(3), ttyname(3), kvm_mkdb(8)HISTORY
The dev_mkdb command appeared in 4.4BSD.
BSD June 1, 2012 BSD
I would write a bash script to format then create a range of folder (folder name is number) to a usb stick.
for numbers in $(seq -w 001 999)
pause "Press any key to start"
mkfs.vfat -F32 /dev/sdc1
mount /dev/sdc1 /media/usb
umount /dev/sdc1... (8 Replies)
Guys , please help me out with another AWK solution ...
Device Physical Name : Not Visible
Device Symmetrix Name : 0743
Front Director Paths (2):
... (5 Replies)
Hi, (i'm sorry for my english)
I'm a problem on boot sco unix 5.0.5 open server.
this stop at "Checking protected password and checking subsystem databases"
(See this image )
I'm try this:
2) SCO: SCO Unix - Server hangs... (9 Replies)
I'm trying to work on a script that will grab a router interface report and generate the numbers of "in use" and "un-used" ports per device. Right now, I've got a cut down of the report as follows:
sing /usr/apps/siteName/etc/DCAFT-9K.cmds for send text
Connecting using... (11 Replies)
Can someone take a look at my scripts what missing, plugin usb drive the script is running can log all my echo but cannot execute command. Is there any configuration in linux or to my scripts need to add?.
What i want to achieve is every time I plugin the usbdisk automatic mount to... (21 Replies)