rsrcdbmgr_devno_detach()

Detach a major and minor number

Synopsis:

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

int rsrcdbmgr_devno_detach( dev_t devno,
                            int flags );

Arguments:

devno
A dev_t object that was returned by rsrcdbmgr_devno_attach().
flags
Presently, there are no flags; pass zero for this argument.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The rsrcdbmgr_devno_detach() function detaches a device number that was attached with rsrcdbmgr_devno_attach(). The process that's detaching the device number must be the process that attached it.

Note: In order to successfully use the rsrcdbmgr_*() functions to modify the resource database, your process must have the PROCMGR_AID_RSRCDBMGR ability enabled. For more information, see procmgr_ability().

If you don't detach a device, it's released when the process that attached it terminates.

Returns:

EOK
Success.
-1
An error occurred (errno is set).

Errors:

EINTR
The call was interrupted by a signal.
EINVAL
One of the following occurred:
  • The major or minor device number in devno is invalid.
  • The device identified by devno isn't registered.
  • The calling process isn't the process that attached the device number.
EPERM
The calling process doesn't have the required permission; see procmgr_ability().

Examples:

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

dev_t   dev_num;
int     flags=0;

…

rsrcdbmgr_devno_detach( dev_num, flags );

Classification:

QNX Neutrino

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