public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: copy_from_user returns a positive value?
Date: Thu, 14 Feb 2002 19:10:20 -0700	[thread overview]
Message-ID: <3C6C6E0C.6000309@candelatech.com> (raw)

I have an IOCTL defined something like this:

	_IOWR (0xfe, (30<<3 + 0), __u8 [696])

I'm really passing in a structure of size 696 (does that matter)?

When I make the copy from user call:

       if ((ret = copy_from_user(&reqconf, arg, sizeof(reqconf)))) {
          printk("ERROR: copy_from_user returned: %i, sizeof(reqconf): %i\n",
                 ret, sizeof(reqconf));
          return ret;
       }

I see this printed out:

ERROR: copy_from_user returned: 696, sizeof(reqconf): 696


According to some docs I saw on the web, it should return 0, or the
number it has left to copy.  So, why does it have 696 bytes left
to copy??

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



             reply	other threads:[~2002-02-15  2:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15  2:10 Ben Greear [this message]
2002-02-15 15:01 ` copy_from_user returns a positive value? Eli Carter
2002-02-15 23:24 ` David S. Miller

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=3C6C6E0C.6000309@candelatech.com \
    --to=greearb@candelatech.com \
    --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