Felix-KM wrote:
I think that could work (only an idea, not tested):


struct Region
{
 void * p;
 size_t s;
};


#define IOBIG _IOWR ('b', 123, struct Region)


userland:

 char data[1000];
 struct Region r;

 r.p = data;
 r.s = sizeof data;
 int error = ioctl (fd, IOBIG, &r);


kernel:
 int my_ioctl(..., caddr_t data, ...)
 {
   ...
   char data[1000];
   ...
   return copyout(data, ((struct Region *) data)->p, ((struct Region *)
data)->s);
 }


Have a try and tell us if it works.


Norbert



Yes! Now the program works!
I have changed the code in this way:

struct Region
{
  void * p;
  size_t s;
};

#define IOBIG _IOWR ('b', 123, struct Region)


Unless your ioctl handler is going to modify values in the Region struct
and pass them back out to userland, you should just use _IOR instead of _IORW.

Scott
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to