Resource Manager Messages

I have a resouce manager that seems to be working.
When I do this:
int uiRes=16;
ret=devctl(fd, POS_DEVCTL_SETRES, &uiRes, sizeof(uiRes), NULL);
The resource manager gets the message (printf statement tells me), and it
does what it’s suppose to do.

However, if I do this:

ret=devctl(fd, POS_DEVCTL_SETRES, (int*)16, sizeof(int), NULL);

The resource manager never gets the message.

What’s wrong?

I know that what I’ve done there is wrong. It passes a pointer value of 16,
instead of a pointer to the value of 16. Newbie mistake!
However, I still don’t know why the resource manager didn’t acknowledge
receiving the message.

“Chris Rose” <chris.rose@viasat.com> wrote in message
news:a3ucib$rr4$1@inn.qnx.com

I have a resouce manager that seems to be working.
When I do this:
int uiRes=16;
ret=devctl(fd, POS_DEVCTL_SETRES, &uiRes, sizeof(uiRes), NULL);
The resource manager gets the message (printf statement tells me), and it
does what it’s suppose to do.

However, if I do this:

ret=devctl(fd, POS_DEVCTL_SETRES, (int*)16, sizeof(int), NULL);

The resource manager never gets the message.

What’s wrong?

Chris Rose <chris.rose@viasat.com> wrote:

I know that what I’ve done there is wrong. It passes a pointer value of 16,
instead of a pointer to the value of 16. Newbie mistake!
However, I still don’t know why the resource manager didn’t acknowledge
receiving the message.

Probably got an EFAULT during the message transfer, what’s the “ret” value
show? I’m willing to bet that *16 isn’t a valid address :slight_smile:

Cheers,
-RK

“Chris Rose” <> chris.rose@viasat.com> > wrote in message
news:a3ucib$rr4$> 1@inn.qnx.com> …
I have a resouce manager that seems to be working.
When I do this:
int uiRes=16;
ret=devctl(fd, POS_DEVCTL_SETRES, &uiRes, sizeof(uiRes), NULL);
The resource manager gets the message (printf statement tells me), and it
does what it’s suppose to do.

However, if I do this:

ret=devctl(fd, POS_DEVCTL_SETRES, (int*)16, sizeof(int), NULL);

The resource manager never gets the message.

What’s wrong?


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Chris Rose <chris.rose@viasat.com> wrote:

I know that what I’ve done there is wrong. It passes a pointer value of 16,
instead of a pointer to the value of 16. Newbie mistake!
However, I still don’t know why the resource manager didn’t acknowledge
receiving the message.

Because when you call “devctl()”, it evantually turns to a
MsgSend(), and kernel decided the address “16” is illegle,
and return a EFAULT back to your application.

The resource manager don’t even know all this happened.

-xtang


“Chris Rose” <> chris.rose@viasat.com> > wrote in message
news:a3ucib$rr4$> 1@inn.qnx.com> …
I have a resouce manager that seems to be working.
When I do this:
int uiRes=16;
ret=devctl(fd, POS_DEVCTL_SETRES, &uiRes, sizeof(uiRes), NULL);
The resource manager gets the message (printf statement tells me), and it
does what it’s suppose to do.

However, if I do this:

ret=devctl(fd, POS_DEVCTL_SETRES, (int*)16, sizeof(int), NULL);

The resource manager never gets the message.

What’s wrong?