Possible Duplicate:
Unsigned long with negative value
I have written one kernel module which interrupts any system call, prints its current user_id and input parameters passed to the system call function. Among them, one is sys_ioctl() as below:
asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd,unsigned long arg);
which means all input parameters are unsigned int numbers.
But when I print input parameters, I get the following output:
fd=21, cmd=-1072143871 and arg=3202983648
fd=21, cmd=-1072143871 and arg=3202983648
fd=21, cmd=-1072143871 and arg=3202983648
----------
Here is my function definition:
asmlinkage long our_sys_ioctl(unsigned int fd , unsigned int cmd , unsigned long arg)
{
uid_t gtuid ;
gtuid = getuid_call();
printk ("our_sys_ioctl ---> uid = %d with fd=%i, cmd=%i and arg=%lu \n ", gtuid, fd, cmd, arg);
return original_call_ioctl(fd , cmd , arg);
}
Any idea why cmd value is negative and what these values mean?