DEVNAME(3) BSD Library Functions Manual DEVNAME(3)NAME
devname, devname_r -- 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. If no device matches the specified values, or no information
is available, NULL is returned.
The devname() function uses a static buffer, which will be overwritten on subsequent calls. The devname_r() functions takes a buffer and
length as arguments to avoid this problem.
The traditional display for applications when no device is found is the string ``??''.
SEE ALSO stat(2), dev_mkdb(8)HISTORY
The devname() function call appeared in 4.4BSD.
BSD October 25, 2004 BSD
Check Out this Related Man Page
GETDEVMAJOR(3) BSD Library Functions Manual GETDEVMAJOR(3)NAME
getdevmajor -- get block or character device major number
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
#include <sys/stat.h>
devmajor_t
getdevmajor(const char *name, mode_t type);
DESCRIPTION
The getdevmajor() function returns the major device number of the block or character device specified by name and a file type matching the
one encoded in type which must be one of S_IFBLK or S_IFCHR.
RETURN VALUES
If no device matches the specified values, no information is available, or an error occurs, NODEVMAJOR is returned and errno is set to indi-
cate the error.
EXAMPLES
To retrieve the major number for pty(4) slave devices (aka pts devices):
#include <stdlib.h>
#include <sys/stat.h>
devmajor_t pts;
pts = getdevmajor("pts", S_IFCHR);
To retrieve the major numbers for the block and character wd(4) devices:
#include <stdlib.h>
#include <sys/stat.h>
devmajor_t c, b;
c = getdevmajor("wd", S_IFCHR);
b = getdevmajor("wd", S_IFBLK);
ERRORS
The getdevmajor() function may fail and set errno for any of the errors specified for the library functions malloc(3) and sysctlbyname(3).
In addition, the following errors may be reported:
[EINVAL] The value of the type argument is not S_IFCHR or S_IFBLK.
[ENOENT] The named device is not found.
SEE ALSO stat(2), devname(3), malloc(3), sysctlbyname(3)HISTORY
The getdevmajor() function call appeared in NetBSD 3.0.
BSD January 20, 2009 BSD
Hi there,
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)
do
pause "Press any key to start"
mkfs.vfat -F32 /dev/sdc1
mount /dev/sdc1 /media/usb
mkdir /media/$numbers
umount /dev/sdc1... (8 Replies)
Guys , please help me out with another AWK solution ...
Input
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:
1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094
2) SCO: SCO Unix - Server hangs... (9 Replies)
Hi folks,
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)
Hi Guys,
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)