lkml.org 
[lkml]   [2002]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectcopy_from_user returns a positive value?
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


-
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: 2005-03-22 13:24    [W:0.038 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site