title: How to decode arg pointer in ioctl() system call in Linux 2.6.29?
body: <p>I want to print all the parameter values passed to <code>linux</code> system calls. In case of <code>ioctl()</code>, for example, I have following prototype and print statement.</p>
  
  <pre><code>asmlinkage long our_sys_ioctl(unsigned int fd ,  unsigned int cmd , unsigned long arg)
  {
      printk ("fd=%u, cmd=%u and arg=%lu \n ", fd, cmd, arg);
      return original_call_ioctl(fd , cmd , arg);
  }
  </code></pre>
  
  <p>I understand, <code>fd</code> is file descriptor of driver files, <code>cmd</code> defines driver , ioctl number, type of operation and size of parameter. But I am confused about <code>arg</code> parameter either it is a pointer to memory or just an immediate value what most of the documentations call it.</p>
  
  <p>By using this <code>arg</code> parameter, how can I get the memory content if it is passed as <code>unsigned long arg</code> as given above, instead of a pointer?</p>