lkml.org 
[lkml]   [2007]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectAdjusting destination pointer with copy_to_user
Date
Hi,

I am passing a packet consisting of a fixed length header and a
variable length data block to a user mode application. The user mode
application passes the pointer of its buffer with an ioctl call
(buff_ptr). When the driver receives buff_ptr, it makes two calls to
pass the packet to user mode:

copy_to_user(buff_ptr, header, header_size);
copy_to_user(buff_ptr + header_size, data, data_size);

Is this a valid usage? Or can I only use buff_ptr here?

Timur
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-12 11:07    [W:0.020 / U:1.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site