ioctl problem
ioctl problem
- Subject: ioctl problem
- From: Ratheesh Ramachandran <email@hidden>
- Date: Fri, 22 Jun 2007 00:16:23 -0700 (PDT)
I am trying to call ioctl against my (kernel) driver. But, for some reason, the string data I am passing to it is not arriving correctly at the driver end.
I have a simple structure like the following, which I am passing to ioctl.
typedef struct {
int datalen;
char *data;
}mystruct;
char *mystring = "sometext";
mystruct datastruct;
datastruct.datalen=strlen(mystring);
datastruct.data="">
int h = open(MY_DEVICE,O_RDWR);
# define MY_COMMAND _IOWR('s', 1, mystruct)
ioctl(h, MY_COMMAND, (char*) &datastruct);
On the driver side, I have my_ioctl function which handles this.
int my_ioctl (dev_t dev, u_long cmd, caddr_t arg,int fflag, struct proc *p)
{
mystruct *mdata = (mystruct*)
arg;
..
..
}
When I inspect mdata->datalen, it has the value as sent by the client. But, mdata->data doesn't have the string which I sent. It has some data I couldn't make sense of.
I am sure I am missing something basic. Could anybody advise ?
Thanks
Ratheesh
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden