Re: userspace access to "u8", "u16", etc. types with filter.h

Khimenko Victor (khim@sch57.msk.ru)
Sat, 23 Jan 1999 17:05:00 +0300 (MSK)


In <199901221958.LAA10673@bmurrell.sympatico.bconnected.net> c22b2f405844e04510a79eef20f630a7@interlinx.bc.ca (c22b2f405844e04510a79eef20f630a7@interlinx.bc.ca) wrote:
> from the quill of Philip Blundell <pb@nexus.co.uk> on scroll
> <E103gyu-0006uz-00@fountain.nexus.co.uk>
>>
>> Including <linux/*> headers from user space is always dubious.

> Indeed. But this brings us to an intersting dilemma. What is a
> userspace program to do when it wants to build an LPF and attach it to a
> socket? It needs the definitions in <linux/filter.h> to build the
> filter.

Copy needed structures to your program and ask glibc folks to add definition
in next glibc version.

>> Either typedef
>> those names yourself or duplicate the structure with types that do
>> exist.

> Uggh! Does this not sound like a deficiency in the kernel interface to
> you? I really shouldn't have to do either of these. There should be a
> "userspace" version of the required data structures shouldn't there?

In glibc. Ask glibc folks to add it. While it's not added just copy
structure to you program. BTW glibc folks could change definition (for
example UID is 16bit in kernel now, but 32bit in glibc) and add wrapper
for syscall -- when this will be done you'll redo your program...

>> AF_PACKET is the new way to do this.

> Cool. Will look into this.

> Thanks very much for your insight on this matter.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/