porting driver and apps containing ioctl() calls

bridged with qnx.newuser
Post Reply
dnewbold

porting driver and apps containing ioctl() calls

Post by dnewbold » Thu May 17, 2007 4:20 pm

porting driver and apps containing ioctl() calls

QNX 6.3 translates application ioctl() calls to resource manager devctl
messages.
When the ioctl() "arg" parameter passes data via a pointer all goes well.
In these cases the data is accessed via the C code "void* data =
_DEVCTL_DATA(msg->i);."
However, I've not found how the access the ioctl() "arg" parameter when it
is a discrete value rather than a pointer.

Any help would be appreciated.

Don

Ken Schumm

Re: porting driver and apps containing ioctl() calls

Post by Ken Schumm » Fri May 18, 2007 12:54 am

"dnewbold" <dnewbold@generalstandards.com> wrote in message
news:f2hv03$75j$2@inn.qnx.com...
porting driver and apps containing ioctl() calls

QNX 6.3 translates application ioctl() calls to resource manager devctl
messages.
When the ioctl() "arg" parameter passes data via a pointer all goes well.
In these cases the data is accessed via the C code "void* data =
_DEVCTL_DATA(msg->i);."
However, I've not found how the access the ioctl() "arg" parameter when it
is a discrete value rather than a pointer.

Any help would be appreciated.
In a driver we do something like this:

int *datap, data ;

datap = (int *) _DEVCTL_DATA(msg->i);
data = *datap ;

David Gibbs

Re: porting driver and apps containing ioctl() calls

Post by David Gibbs » Fri May 18, 2007 1:29 pm

dnewbold <dnewbold@generalstandards.com> wrote:
porting driver and apps containing ioctl() calls

QNX 6.3 translates application ioctl() calls to resource manager devctl
messages.
When the ioctl() "arg" parameter passes data via a pointer all goes well.
In these cases the data is accessed via the C code "void* data =
_DEVCTL_DATA(msg->i);."
However, I've not found how the access the ioctl() "arg" parameter when it
is a discrete value rather than a pointer.
Hm... devctl() takes all data as a "void *". Maybe pass the address of the
arg parameter to ioctl?

-David
--
David Gibbs
QNX Training Services
dagibbs@qnx.com

Post Reply

Return to “qnx.newuser”