IOCTL number differs from kernel space
Jeshwanth Kumar N K Jeshu
jeshkumar555 at gmail.com
Thu Jan 3 13:30:03 EST 2013
Hello All,
I am trying IOCTL example provided in http://linux.die.net/lkmpg/x892.html,
both user-space and kernel space using same chardev.h file for IOCTL
number. But the number receiving in kernel is different than number in
kernel. I printed both the received number and defined number in dmesg,
please find it below.
// IOCTL number which is in kernel
[ 6417.807403] Value of IOCTL_GET_NTH_BYTE: -1073454078
[ 6417.807398] Value of IOCTL_GET_MSG: -2147195903
[ 6417.807391] Value of IOCTL_SET_MSG: -2147195904
// IOCTL number which is received by kernel.
[ 6426.691360] Passed IOCTL:number 0
[ 6426.691464] Passed IOCTL:number -1074930088
[ 6426.691537] Passed IOCTL:number 134514878
Can you please tell why this number is getting changed while receiving in
kernel ?
// Here is the definition of numbers.
#define MAJOR_NUM 100
#define IOCTL_SET_MSG _IOR(MAJOR_NUM, 0, char *)
#define IOCTL_GET_MSG _IOR(MAJOR_NUM, 1, char *)
#define IOCTL_GET_NTH_BYTE _IOWR(MAJOR_NUM, 2, int)
--
Regards
Jeshwanth Kumar N K
+91-7411483498
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130104/a8b3d142/attachment.html
More information about the Kernelnewbies
mailing list