Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 8

resmgr_handler()

Handle resource manager messages

Synopsis:

#include <sys/iofunc.h>
#include <sys/dispatch.h>

int resmgr_handler( resmgr_context_t * ctp );

Arguments:

ctp
A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.

Library:

libc

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

Description:

The resmgr_handler() function handles the message received in ctp. This function handles different I/O messages through the resource manager framework.


Note: The resmgr_handler() function is a special case of dispatch_handler(). You should use it only when writing a simple resource manager i.e. where there's no need to attach pulses or messages.

Returns:

0
Success.
-1
An error occurred.

Examples:

#include <sys/dispatch.h>
#include <stdio.h>
#include <stdlib.h>

int main( int argc, char **argv ) {
   dispatch_t          *dpp;
   resmgr_context_t    *ctp;

   if ((dpp = dispatch_create()) == NULL) {
      fprintf( stderr, "%s: Unable to allocate \
               dispatch handle.\n",argv[0] );
      return EXIT_FAILURE;
   }

   …

   ctp = resmgr_context_alloc( dpp );

   while (1) {
     if ( ( ctp = resmgr_block( ctp )) == NULL ) {
        fprintf( stderr, "block error\n" );
        return EXIT_FAILURE;
     }
     resmgr_handler( ctp );
   }
}

For examples using the dispatch interface, see dispatch_create(), message_attach(), resmgr_attach(), and thread_pool_create().

Classification:

QNX Neutrino

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

Caveats:

If you attach messages or pulses to dpp by calling message_attach(), pulse_attach(), or select_attach(), those events aren't dispatched by resmgr_handler(). Instead, you should call dispatch_handler().

See also:

dispatch_handler(), resmgr_attach(), resmgr_block()

Layers in a resource manager in the Bones of a Resource Manager chapter of Writing a Resource Manager

Resource Managers chapter of Getting Started with QNX Neutrino


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 193

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/resmgr_handler.html on line 193