title: Copying a 2D array of char * to user space from kernel space?
body: <p>In kernel space, I have the following:</p>
  
  <pre><code>char * myData[MAX_BUF_SIZE][2];
  </code></pre>
  
  <p>I need to define a kernel method that copies this data into user-space., so how would I go about defining this method? I've got the following, but I'm not quite sure what I'm doing.</p>
  
  <pre><code>asmlinkage int sys_get_my_data(char __user ***data, int rowLen, int bufferSize) {
      if (rowLen &lt; 1 || bufferSize &lt; 1 || rowLen &gt; MAX_BUF_SIZE || bufferSize
              &gt; MAX_BUF_SIZE) {
          return -1;
      }
  
      if( copy_to_user( data, myData, rowLen * bufferSize * dataCounter * 2) )
      {
          printk( KERN_EMERG "Copy to user failure for get all minifiles\n" );
          return -1;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Help?</p>