[Previous] [Contents] [Next]

rsrcdbmgr_devno_attach()

Get a major and minor number

Synopsis:

#include <sys/rsrcdbmgr.h>
#include <sys/rsrcdbmsg.h>

dev_t rsrcdbmgr_devno_attach( char *name,
                              int minor_request,
                              int flags );

Library:

libc

Description:

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).

Returns:

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.

Errors:

EINVAL
Invalid argument.

Examples:

#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 );

Classification:

QNX 6

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

rsrcdbmgr_attach(), rsrcdbmgr_devno_detach()


[Previous] [Contents] [Next]