Re: [BUGI] IOCTL :Facing problems while acccessing data from kernel space
On 28.09-13:40, rashmi ns wrote: [ ... ] I was trying to add a new ioctl command like #define HDLCMODE _IOR('6',0xF,int) when i trying to uprintf the data which was sent from the user-space in the device-driver-ioctl-routine i'll get a different value than which was passed. Can anybody please tell me why this is happening . I pass the address of an integer where data is stored from the user space as third arg to the ioctl call . i would guess that it's a simple typo and your pointer conversions are off somewhere. i.e. uprintf( %d, (int*)data ) ; instead of uprintf( %d, *(int*)data ) ; otherwise, use a debugger or post the code. -- t t w ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
IOCTL :Facing problems while acccessing data from kernel space
Hello All , Sorry for resending the message many times !!!. I was trying to add a new ioctl command like #define HDLCMODE _IOR('6',0xF,int) when i trying to uprintf the data which was sent from the user-space in the device-driver-ioctl-routine i'll get a different value than which was passed. Can anybody please tell me why this is happening . I pass the address of an integer where data is stored from the user space as third arg to the ioctl call . Thanks and regards, Rashmi.N.S ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IOCTL :Facing problems while acccessing data from kernel space
rashmi ns wrote: #define HDLCMODE _IOR('6',0xF,int) when i trying to uprintf the data which was sent from the user-space in the device-driver-ioctl-routine i'll get a different value than which was passed. Can anybody please tell me why this is happening . I pass the address of an integer where data is stored from the user space as third arg to the ioctl call . maybe you should show how you do it in kernel. I suspect you try to access it as an int* as well, which is wrong. The kernel already does take care of this for you. Just write the integer you want to pass into the data area and you're done. cheers simon -- Serve - BSD +++ RENT this banner advert +++ASCII Ribbon /\ Work - Mac +++ space for low $$$ NOW!1 +++ Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]