DEV_MKDB(8) BSD System Manager's Manual DEV_MKDB(8)NAME
dev_mkdb -- create /dev database
SYNOPSIS
dev_mkdb
DESCRIPTION
The dev_mkdb command creates a db(3) hash access method database in ``/var/run/dev.db'' which contains the names of all of the character and
block special files in the ``/dev'' directory, using the file type and the st_rdev field as the key.
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.
FILES
/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 6, 1993 BSD
Check Out this Related Man Page
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);
char *
fdevname(int fd);
char *
fdevname_r(int fd, 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.
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.
EXAMPLES
int fd;
struct stat buf;
char *name;
fd = open("/dev/tun");
fstat(fd, &buf);
printf("devname is /dev/%s
", devname(buf.st_rdev, S_IFCHR));
printf("fdevname is /dev/%s
", fdevname(fd));
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
Hello All,
need help with the df command....
If I do this: df -kh /var
Filesystem Size Used Avail Use% Mounted on
/dev/sda15 17G 5.8G 9.9G 38% /var
How can I display, in the same way, the usage of each directory inside the /var?
thanks for the help! (2 Replies)
Hello,
After, I stat() a file, how can I read the various permissions flags from the st_mode variable which is of type mode_t? I would like to do something like:
struct stat *perms;
int res = stat(filename, perms);
if(perms->st.mode == S_IROTH) do something;
but I know that is the wrong... (2 Replies)
How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&"
echo "hello" > /dev/null 2>&1
echo "hello" > /dev/null 2>1 (3 Replies)
Hello,
I want to modify the /var/run fs from 86G to say 2G. How to go about it? Thanks.
swap 64G 38K 64G 1% /var/run
Regards.
Edit/Delete Message (6 Replies)
I want to run a find command on the UNIX directory for all type -c and type -b files, then verify they are located in the default /dev directory.
Problem is I get such a huge list of files when I run the search, I think it would be easier if I simply did a search for all type -c and type -b... (6 Replies)