Hi Matt,
The man page for ddi_cpopyin contains an example. See if ddi_copyin(9F) 
helps.

Out here, looks like you are not allocating a buffer for strPtr. I am 
also not sure if you would like to use "sizeof(char *)" in the third 
argument to ddi_copyin().

Thanks
Suraj

Matt Bailey wrote:
> I'm trying to use ddi_copyin to copy a string from a user application to a 
> psuedo driver in kernel space.
>
> How do I copy data and print it out?  Anyone know of any resources I can look 
> at with an example?
>
> Here's the ioctl code:
>
> char *strPtr, *string;
> ...
>                 case STR_COPY:
>                         ddi_copyin((char *)arg, strPtr, sizeof (char*), mode);
>                         strcpy(string, strPtr); // EXPLODES HERE
>                       break;
> ...
>
> User code:
>
>                         ioctl(fd, STR_COPY, stringPtr);
>
> New to driver programming, be gentle...
>
> Thanks
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>   

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to