porting driver and apps containing ioctl() calls

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

“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 ;

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