problem with ioctl handler in a module

[ Available lists | Index of freebsd-hackers | Month of May 2000 | Week of 6 May 2000 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Alexander Langer <alex@big.endian.de>
Date
6 May 2000 11:09:56
Subject
problem with ioctl handler in a module
Message-ID
20000506200940.A8087@cichlids.cichlids.com

Replies
Referenced by

[ Hide this part ]
Hello!

I have:

int ziva_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct
proc* pr)

when this function catches a ioctl from userspace, called as:
int foo = 199;
ioctl(fd, 10, &foo);

the u_long cmd contains 10, which is correct (so the ioctl-handler is
called correctly).

However, I can't get the value of the int.

I tried something like:
if (*((int *) arg) == 199)
<bleh>.

But this doesn't work, <bleh> is not executed. Somehow, I can't access
the memory this way.

Anyone knows, what I'm doing wrong?

Thanks

Alex
--
I need a new ~/.sig.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Elapsed time: 0.070 seconds