I’ve already tried this to no avail. I get the same exact error with
this flag enabled. I’ve already posted this problem to comp.os.qnx and
gotten some replies, so you can check there for reference as well.
Here is the resmgr setup code and the function that tries to open the
resmgr.
Thanks for your help.
int telMsgServer::loop(char * path)
{
resmgr_attr_t resmgr_attr;
message_attr_t message_attr;
dispatch_t *dpp;
int resmgr_id = 0;
int message_id = 0;
dispatch_context_t *ctp, *ctp_ret;
static resmgr_connect_funcs_t ConnectFuncs;
static resmgr_io_funcs_t IoFuncs;
iofunc_attr_t IoFuncAttr;
/* Create the Dispatch Interface */
dpp = dispatch_create();
if( dpp == NULL )
{
fprintf( stderr, “dispatch_create() failed: %s\n”,
strerror( errno ) );
return EXIT_FAILURE;
}
memset( &resmgr_attr, 0, sizeof( resmgr_attr ) );
resmgr_attr.nparts_max = 1;
resmgr_attr.msg_max_size = 255;
resmgr_attr.flags = _RESMGR_FLAG_SELF;
/* Setup the default I/O functions to handle open/read/write/… */
iofunc_func_init( _RESMGR_CONNECT_NFUNCS, &ConnectFuncs,
_RESMGR_IO_NFUNCS, &IoFuncs );
/* Setup the attribute for the entry in the filesystem */
iofunc_attr_init( &IoFuncAttr, S_IFNAM | 0666, 0, 0 );
resmgr_id = resmgr_attach( dpp, &resmgr_attr, path, _FTYPE_ANY,
0, &ConnectFuncs, &IoFuncs, &IoFuncAttr );
if( resmgr_id == -1 )
{
char errMsg[255];
sprintf(errMsg, “resmgr_attach() failed: %s\n”, strerror( errno ) );
PtEnter(Pt_EVENT_PROCESS_PREVENT);
PtMultiTextModifyText(ABW_msgTxt, 1, 1, -1, errMsg,
sizeof(errMsg), NULL, 0);
PtLeave(Pt_EVENT_PROCESS_PREVENT);
return EXIT_FAILURE;
}
/* Setup our message handler */
memset( &message_attr, 0, sizeof( message_attr ) );
message_attr.nparts_max = 1;
message_attr.msg_max_size = 255;
/* Attach a handler for all command messages /
message_id = message_attach( dpp, &message_attr, _IO_MAX + 1,
_IO_MAX + 20, &msgHandlerWrapper, (void)this );
if( message_id == -1 )
{
fprintf( stderr, “message_attach() failed: %s\n”, strerror( errno ) );
return EXIT_FAILURE;
}
/* Setup a context for the dispatch layer to use */
ctp = dispatch_context_alloc( dpp );
if( ctp == NULL )
{
fprintf( stderr, “dispatch_context_alloc() failed: %s\n”,
strerror( errno ) );
return EXIT_FAILURE;
}
/* The “Data Pump” - get and process messages */
while( 1 )
{
ctp_ret = dispatch_block( ctp );
if( ctp_ret )
{
dispatch_handler( ctp );
}
else
{
fprintf( stderr, “dispatch_block() failed: %s\n”,
strerror( errno ) );
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
int
openResMgr( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
char post[255];
int telMsgFd;
char telPath[20];
sprintf(telPath, “/dev/telemetry”);
telMsgFd = open(telPath, O_RDWR);
sprintf(post,“path = %s\ntelMsgFd = %d\nerr = %s\n”, telPath, telMsgFd,
strerror(errno));
PtMultiTextModifyText(ABW_msgTxt, 1, 1, -1, post,
strlen(post), NULL, 0);
/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
return (Pt_CONTINUE);
}