public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* copy_from_user returns a positive value?
@ 2002-02-15  2:10 Ben Greear
  2002-02-15 15:01 ` Eli Carter
  2002-02-15 23:24 ` David S. Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Greear @ 2002-02-15  2:10 UTC (permalink / raw)
  To: linux-kernel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-15 23:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-15  2:10 copy_from_user returns a positive value? Ben Greear
2002-02-15 15:01 ` Eli Carter
2002-02-15 23:24 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox