[RFC][PATCH] user-cr: Extract kernel headers

Oren Laadan orenl at librato.com
Mon Aug 17 14:00:35 PDT 2009



Matt Helsley wrote:
> On Mon, Aug 17, 2009 at 08:24:03AM -0700, Matt Helsley wrote:
>> Using kernel headers directly from userspace is strongly discouraged.
>> This patch attempts to sanitize kernel headers for userspace by
>> extracting non-__KERNEL__ portions of the various checkpoint headers
>> and placing them in a similar organization of userspace headers.
>>
>> The script is run from the top level of the user-cr source tree like:
>>
>> 	./scripts/extract-headers.sh -s <path-to-kern-source> -o ./include
>>
>>
>> The patch includes a copy of the auto-generated headers and adjusts
>> the user-cr programs to use them.
>>
>> Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
>>
>> TODO: Builds on i386. Probably needs more testing, especially on
>> 	other non-i386, non-32-bit platforms.
> 
> Argh. Still one build problem that the script doesn't resolve. From the
> kernel headers:
> 
> #include <linux/socket.h>
> #include <linux/un.h>
> 
> I think these need to be changed to use sys/ instead of linux/ but I
> can't see a good way to do this without hardcoding it into the script
> or replacing _all_ "linux/" includes with "sys/" (but I haven't checked
> if that will work much less if it's a good solution..). Would be nice
> to know if anyone has preferences or knows kernel/user header conventions
> I don't....

I don't either .. but - I'd guess that s;linux/;sys/; should work ?
(you probably mean the ones in include/linux/checkpoint_hdr.h...)

Oren.



More information about the Containers mailing list