RE: Simple LKM & copy_from_user question (followup)

David CM Weber (dweber@backbonesecurity.com)
Fri, 20 Jul 2001 16:26:43 -0400


This is a multi-part message in MIME format.

------_=_NextPart_001_01C1115A.4A8AC0D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Attached is the file I"m having problems with. I'm compiling it w/=20

gcc -O3 -c main.c

Thanks in advance,

Dave Weber
Backbone Security, Inc.
570-422-7900

> -----Original Message-----
> From: David CM Weber=20
> Sent: Friday, July 20, 2001 12:45 PM
> To: linux-kernel@vger.kernel.org
> Subject: Simple LKM & copy_from_user question
>=20
>=20
> Hello all. I've been lurking for a while, and I have a quick=20
> question.
> I'm in the process of writing my first LKM to mess with the
> sys_socketcall function. I'm looking at the original one for=20
> guidance,
> and it makes a call to copy_from_user() to get some=20
> socket-related data.
>=20
> So, to use copy_from_user(), I've gathered that I need to #include
> <asm/uaccess.h>, so I do so. =20
>=20
> After including this file, I'm getting the following errors:
>=20
>=20
> .../linux/timer.h:21: field 'vec' has incomplete type
>=20
> .../asm/uaccess.h::63: dereferencing pointer to incomplete type
>=20
>=20
> (This is not a full list of the error message that it's reporting)
>=20
> Am I not setting a define correctly?=20
>=20
> I'm using Redhat 7.1, on an Intel P3 system. It's the latest stable
> release (2.4.x ??) of the kernel.
>=20
>=20
>=20
> If you need more information, please let me know. This has been
> troubling me for several days now..
>=20
>=20
> Thanks,
>=20
>=20
> Dave Weber
> Backbone Security, Inc.
> 570-422-7900
> -
> To unsubscribe from this list: send the line "unsubscribe=20
> 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/
>=20

------_=_NextPart_001_01C1115A.4A8AC0D0
Content-Type: application/octet-stream;
name="main.c"
Content-Transfer-Encoding: base64
Content-Description: main.c
Content-Disposition: attachment;
filename="main.c"

I2RlZmluZSBNT0RVTEUgLy8gdGhpcyBpcyBhIExLTQojaW5jbHVkZSA8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nNpZ25lZCBsb25nIGEwLGExOwoKCWludCBlcnI7CgoJaWYo
Y2FsbCA8IDEgfHwgY2FsbCA+IFNZU19SRUNWTVNHKQoJCXJldHVybiAtRUlOVkFMOwoKCS8vIGNv
cHlfZnJvbV91c2VyIHNob3VsZCBiZSBTTVAgc2FmZS4KCWlmIChjb3B5X2Zyb21fdXNlcihhLCBh
cmdzLCBuYXJnc1tjYWxsXSkpCgkJcmV0dXJuIC1FRkFVTFQ7CgkJCglhMD1hWzBdOwoJYTE9YVsx
XTsKCgoJLy8gQ2FsbCB0aGUgb3JpZ2luYWwgZnVuY3Rpb24KCXJldHVybihvcmlnaW5hbF9zb2Nr
ZXRjYWxsKGNhbGwsIGFyZ3MpKTsKfQo=

------_=_NextPart_001_01C1115A.4A8AC0D0--
-
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/