mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Timur Aydin <ta@taydin.org>
To: linux-kernel@vger.kernel.org
Subject: Adjusting destination pointer with copy_to_user
Date: Mon, 12 Feb 2007 11:39:44 +0200	[thread overview]
Message-ID: <87ire7af4v.fsf@bonsai.taydin.org> (raw)

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

                 reply	other threads:[~2007-02-12 10:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ire7af4v.fsf@bonsai.taydin.org \
    --to=ta@taydin.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®