Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2000 20:09:40 +0200
From:      Alexander Langer <alex@big.endian.de>
To:        hackers@freebsd.org
Subject:   problem with ioctl handler in a module
Message-ID:  <20000506200940.A8087@cichlids.cichlids.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000506200940.A8087>