Get a major and minor number
#include <sys/rsrcdbmgr.h>
#include <sys/rsrcdbmsg.h>
dev_t rsrcdbmgr_devno_attach( char *name,
int minor_request,
int flags );
libc
The function rsrcdbmgr_devno_attach() gets a name major number and minor_request minor number. You can extract the major and minor number values from dev_t using the major() and minor() macros defined in <sys/types.h> (see stat() for descriptions). There's a maximum of 64 majors and a maximum of 1024 minors.
Presently, there are no flags (flags = 0).
A major and minor number. If you specify -1 in minor_request, the function returns the first free minor number. If an error occurs, the function returns -1 and sets errno.
#include <sys/rsrcdbmgr.h>
#include <sys/rsrcdbmsg.h>
char *dev_name;
int myminor_request, flags=0;
dev_t major_minor;
major_minor = rsrcdbmgr_devno_attach
( dev_name, myminor_request, flags );
...
rsrcdbmgr_devno_detach( major_minor, flags );
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
rsrcdbmgr_attach(), rsrcdbmgr_devno_detach()