lkml.org 
[lkml]   [2001]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ioctl arg passing
Matt aka Doofus festures mentioned the following:

| struct instruction_t local;
| __s16 *temp;
|
| copy_from_user( &local, ( struct instruction_t * ) arg, sizeof( struct instruction_t ) );
| temp = kmalloc( sizeof( __s16 ) * local.rxlen, GFP_KERNEL );
| copy_from_user( temp, arg, sizeof( __s16 ) * local.rxlen );

I meant that last line to be:

copy_from_user( temp, local.rxbuf, sizeof( __s16 ) * local.rxlen );
^^^^^^^^^^^

Which'd clear up any confusion as to why I'd want two copies of the same
argument.

That's the main crux of my query, can I retrieve the value of a pointer
in some struct passed via ioctl? In this case, the struct/chunk of memory
referenced by local.rxbuf, (which is rxlen x 2 bytes big).

Apologies, I'm a muppet.

Matt

PS. Thanks for the help so far, I'd meant to add error checking and what
not, I just kept it out to keep the e-mail smaller.

-
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:27    [W:0.060 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site