rsrcdbmgr_devno_attach() and major and minor numbers

Hi,

The following is related to resource managers in QNX 6.1:

Is the function rsrcdbmgr_devno_attach() necessary in a resource manager?
If not, what does using it gain you aside from the obvious? I have the
documentation
that it retrieves a major and minor number. What does this mean? Does it
create
a mapping between the path passed in the name argument
(rsrcdbmgr_devno_attach (char *name, int minor_request, int flags) that is
used
by the operating system? What side effects does it have if any?

I would like to know because I have a version of a resource manager that
uses this function to fill in the rdev member of the (struct iofunc_attr_t)
type
variable. This happens before resmgr_attach() is called to set up the
association
between the path namespace and the resource manager handlers. The rdev
member
doesn’t seem to get used anywhere in the future but I am not sure.

Any info on this would be much appreciated! Thanks!

Daniel

carlo latasa <carlol@berkeleyprocess.com> wrote:

Hi,

The following is related to resource managers in QNX 6.1:

Is the function rsrcdbmgr_devno_attach() necessary in a resource manager?
If not, what does using it gain you aside from the obvious? I have the
documentation
that it retrieves a major and minor number. What does this mean? Does it
create
a mapping between the path passed in the name argument
(rsrcdbmgr_devno_attach (char *name, int minor_request, int flags) that is
used
by the operating system? What side effects does it have if any?

Strictly speaking it is not necessary in most resource managers. What
it does do is guarantee you a unique minor/major number which is provided
by the system (and consequently released upon the death of your manager).

Unfortunately the minor/major numbers are a scarce resource (64 majors with
1024 minors each). If you do not select your own major/minor, then the system
will assign you the shared system major and a unique minor.

I would like to know because I have a version of a resource manager that
uses this function to fill in the rdev member of the (struct iofunc_attr_t)
type
variable. This happens before resmgr_attach() is called to set up the
association
between the path namespace and the resource manager handlers. The rdev
member
doesn’t seem to get used anywhere in the future but I am not sure.

There is no mapping between the major/minor numbers and the pathname
space at this time. The rdev exposure comes in the stat() call and
some utilities will use this with the inode to track visits.

Thomas

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Core OS Technology Group
(613)-591-0931 http://www.qnx.com/