Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gentoo-headers/2.6.28: 0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch 0002-linux-timex.h-cleanup-for-userspace.patch 0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch 0004-linux-uio.h-cleanup-for-userspace.patch 0005-headers_check.pl-disallow-extern-s.patch 0006-headers_install.pl-autoconvert-asm-inline-volatile.patch 0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch 0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch 0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch 0010-kbuild-auto-convert-size-types-in-userspace-headers.patch 0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch 0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch 0013-linux-pull-in-other-needed-headers-for-userspace.patch 0014-HACK-asm-pull-in-C-library-headers.patch 0015-HACK-linux-pull-in-C-library-headers.patch 00_all_headers_install.pl-autoconvert-asm-inline-volatile.patch 00_a ll_kbuild-auto-co nvert-size-types-in-userspace-headers.patch 00_all_linux-elf.h-remove-kernel-prototypes-for-userspace.patch 00_all_linux-serial.h-pull-in-linux-types.h-for-userspace.patch 00_all_linux-timex.h-cleanup-for-userspace.patch 00_all_linux-uio.h-cleanup-for-userspace.patch 00_all_x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch 03_all_linux-export-aligned-64bits.patch 05_all_no-glibc-ifdefs.patch 07_all_pull-libc-headers-asm.patch 07_all_pull-libc-headers-linux.patch 09_all_include-other-linux-headers.patch
Date: Mon, 29 Dec 2008 13:00:24
Message-Id: E1LHHjF-0005rv-V5@stork.gentoo.org
1 vapier 08/12/29 13:00:17
2
3 Added:
4 0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch
5 0002-linux-timex.h-cleanup-for-userspace.patch
6 0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch
7 0004-linux-uio.h-cleanup-for-userspace.patch
8 0005-headers_check.pl-disallow-extern-s.patch
9 0006-headers_install.pl-autoconvert-asm-inline-volatile.patch
10 0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch
11 0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch
12 0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch
13 0010-kbuild-auto-convert-size-types-in-userspace-headers.patch
14 0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch
15 0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch
16 0013-linux-pull-in-other-needed-headers-for-userspace.patch
17 0014-HACK-asm-pull-in-C-library-headers.patch
18 0015-HACK-linux-pull-in-C-library-headers.patch
19 Removed:
20 00_all_headers_install.pl-autoconvert-asm-inline-volatile.patch
21 00_all_kbuild-auto-convert-size-types-in-userspace-headers.patch
22 00_all_linux-elf.h-remove-kernel-prototypes-for-userspace.patch
23 00_all_linux-serial.h-pull-in-linux-types.h-for-userspace.patch
24 00_all_linux-timex.h-cleanup-for-userspace.patch
25 00_all_linux-uio.h-cleanup-for-userspace.patch
26 00_all_x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch
27 03_all_linux-export-aligned-64bits.patch
28 05_all_no-glibc-ifdefs.patch
29 07_all_pull-libc-headers-asm.patch
30 07_all_pull-libc-headers-linux.patch
31 09_all_include-other-linux-headers.patch
32 Log:
33 switch to git-style patches
34
35 Revision Changes Path
36 1.1 src/patchsets/gentoo-headers/2.6.28/0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch
37
38 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch?rev=1.1&view=markup
39 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch?rev=1.1&content-type=text/plain
40
41 Index: 0001-x86-setup.h-hide-kernel-stuff-behind-__KERNEL__-for.patch
42 ===================================================================
43 From e1609036c1d145b3e60bfc6ce68168f9cabeaff5 Mon Sep 17 00:00:00 2001
44 From: Mike Frysinger <vapier@g.o>
45 Date: Sat, 27 Dec 2008 00:58:20 -0500
46 Subject: [PATCH] x86/setup.h: hide kernel stuff behind __KERNEL__ for userspace
47
48 The x86 setup.h bleeds a bunch of kernel functions/structs to userspace, so
49 move them behind __KERNEL__.
50
51 Signed-off-by: Mike Frysinger <vapier@g.o>
52 ---
53 arch/x86/include/asm/setup.h | 4 ++--
54 1 files changed, 2 insertions(+), 2 deletions(-)
55
56 diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
57 index f12d372..e4c80fe 100644
58 --- a/arch/x86/include/asm/setup.h
59 +++ b/arch/x86/include/asm/setup.h
60 @@ -3,6 +3,8 @@
61
62 #define COMMAND_LINE_SIZE 2048
63
64 +#ifdef __KERNEL__
65 +
66 #ifndef __ASSEMBLY__
67
68 /* Interrupt control for vSMPowered x86_64 systems */
69 @@ -49,8 +51,6 @@ extern unsigned long saved_video_mode;
70 #endif
71 #endif /* __ASSEMBLY__ */
72
73 -#ifdef __KERNEL__
74 -
75 #ifdef __i386__
76
77 #include <linux/pfn.h>
78 --
79 1.6.0.6
80
81
82
83
84 1.1 src/patchsets/gentoo-headers/2.6.28/0002-linux-timex.h-cleanup-for-userspace.patch
85
86 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0002-linux-timex.h-cleanup-for-userspace.patch?rev=1.1&view=markup
87 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0002-linux-timex.h-cleanup-for-userspace.patch?rev=1.1&content-type=text/plain
88
89 Index: 0002-linux-timex.h-cleanup-for-userspace.patch
90 ===================================================================
91 From 6454cdad97da7776c0dcedf8c926382a778c52b5 Mon Sep 17 00:00:00 2001
92 From: Mike Frysinger <vapier@g.o>
93 Date: Sun, 26 Oct 2008 06:31:48 -0400
94 Subject: [PATCH] linux/timex.h: cleanup for userspace
95
96 Move all the kernel-specific defines and includes into the __KERNEL__
97 section so that they don't get leaked into userspace.
98
99 Signed-off-by: Mike Frysinger <vapier@g.o>
100 ---
101 include/linux/timex.h | 73 +++++++++++++++++++++++++------------------------
102 1 files changed, 37 insertions(+), 36 deletions(-)
103
104 diff --git a/include/linux/timex.h b/include/linux/timex.h
105 index 9007313..4bbbab5 100644
106 --- a/include/linux/timex.h
107 +++ b/include/linux/timex.h
108 @@ -53,47 +53,11 @@
109 #ifndef _LINUX_TIMEX_H
110 #define _LINUX_TIMEX_H
111
112 -#include <linux/compiler.h>
113 #include <linux/time.h>
114
115 -#include <asm/param.h>
116 -
117 #define NTP_API 4 /* NTP API version */
118
119 /*
120 - * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
121 - * for a slightly underdamped convergence characteristic. SHIFT_KH
122 - * establishes the damping of the FLL and is chosen by wisdom and black
123 - * art.
124 - *
125 - * MAXTC establishes the maximum time constant of the PLL. With the
126 - * SHIFT_KG and SHIFT_KF values given and a time constant range from
127 - * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
128 - * respectively.
129 - */
130 -#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
131 -#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
132 -#define MAXTC 10 /* maximum time constant (shift) */
133 -
134 -/*
135 - * SHIFT_USEC defines the scaling (shift) of the time_freq and
136 - * time_tolerance variables, which represent the current frequency
137 - * offset and maximum frequency tolerance.
138 - */
139 -#define SHIFT_USEC 16 /* frequency offset scale (shift) */
140 -#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
141 -#define PPM_SCALE_INV_SHIFT 19
142 -#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
143 - PPM_SCALE + 1)
144 -
145 -#define MAXPHASE 500000000l /* max phase error (ns) */
146 -#define MAXFREQ 500000 /* max frequency error (ns/s) */
147 -#define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT)
148 -#define MINSEC 256 /* min interval between updates (s) */
149 -#define MAXSEC 2048 /* max interval between updates (s) */
150 -#define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */
151 -
152 -/*
153 * syscall interface - used (mainly by NTP daemon)
154 * to discipline kernel clock oscillator
155 */
156 @@ -199,9 +163,46 @@ struct timex {
157 #define TIME_BAD TIME_ERROR /* bw compat */
158
159 #ifdef __KERNEL__
160 +#include <linux/compiler.h>
161 +#include <linux/types.h>
162 +
163 +#include <asm/param.h>
164 #include <asm/timex.h>
165
166 /*
167 + * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
168 + * for a slightly underdamped convergence characteristic. SHIFT_KH
169 + * establishes the damping of the FLL and is chosen by wisdom and black
170 + * art.
171 + *
172 + * MAXTC establishes the maximum time constant of the PLL. With the
173 + * SHIFT_KG and SHIFT_KF values given and a time constant range from
174 + * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
175 + * respectively.
176 + */
177 +#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
178 +#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
179 +#define MAXTC 10 /* maximum time constant (shift) */
180 +
181 +/*
182 + * SHIFT_USEC defines the scaling (shift) of the time_freq and
183 + * time_tolerance variables, which represent the current frequency
184 + * offset and maximum frequency tolerance.
185 + */
186 +#define SHIFT_USEC 16 /* frequency offset scale (shift) */
187 +#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
188 +#define PPM_SCALE_INV_SHIFT 19
189 +#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
190 + PPM_SCALE + 1)
191 +
192 +#define MAXPHASE 500000000l /* max phase error (ns) */
193 +#define MAXFREQ 500000 /* max frequency error (ns/s) */
194 +#define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT)
195 +#define MINSEC 256 /* min interval between updates (s) */
196 +#define MAXSEC 2048 /* max interval between updates (s) */
197 +#define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */
198 +
199 +/*
200 * kernel variables
201 * Note: maximum error = NTP synch distance = dispersion + delay / 2;
202 * estimated error = NTP dispersion.
203 --
204 1.6.0.6
205
206
207
208
209 1.1 src/patchsets/gentoo-headers/2.6.28/0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch
210
211 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch?rev=1.1&view=markup
212 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch?rev=1.1&content-type=text/plain
213
214 Index: 0003-linux-elf.h-remove-kernel-prototypes-for-userspace.patch
215 ===================================================================
216 From 428c23f88c0ec9bd75945705ecc0c59501b07766 Mon Sep 17 00:00:00 2001
217 From: Mike Frysinger <vapier@g.o>
218 Date: Sat, 27 Dec 2008 01:05:27 -0500
219 Subject: [PATCH] linux/elf.h: remove kernel prototypes for userspace
220
221 The internal elf notes funcs do are for the kernel-only, so hide them
222 behind __KERNEL__.
223
224 Signed-off-by: Mike Frysinger <vapier@g.o>
225 ---
226 include/linux/elf.h | 2 ++
227 1 files changed, 2 insertions(+), 0 deletions(-)
228
229 diff --git a/include/linux/elf.h b/include/linux/elf.h
230 index 0b61ca4..1b6e350 100644
231 --- a/include/linux/elf.h
232 +++ b/include/linux/elf.h
233 @@ -395,6 +395,7 @@ extern Elf64_Dyn _DYNAMIC [];
234
235 #endif
236
237 +#ifdef __KERNEL__
238 /* Optional callbacks to write extra ELF notes. */
239 #ifndef ARCH_HAVE_EXTRA_ELF_NOTES
240 static inline int elf_coredump_extra_notes_size(void) { return 0; }
241 @@ -404,5 +405,6 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
242 extern int elf_coredump_extra_notes_size(void);
243 extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
244 #endif
245 +#endif
246
247 #endif /* _LINUX_ELF_H */
248 --
249 1.6.0.6
250
251
252
253
254 1.1 src/patchsets/gentoo-headers/2.6.28/0004-linux-uio.h-cleanup-for-userspace.patch
255
256 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0004-linux-uio.h-cleanup-for-userspace.patch?rev=1.1&view=markup
257 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0004-linux-uio.h-cleanup-for-userspace.patch?rev=1.1&content-type=text/plain
258
259 Index: 0004-linux-uio.h-cleanup-for-userspace.patch
260 ===================================================================
261 From dda9c6313a67d097283afde7b6b608b3c0920302 Mon Sep 17 00:00:00 2001
262 From: Mike Frysinger <vapier@g.o>
263 Date: Sat, 27 Dec 2008 01:11:46 -0500
264 Subject: [PATCH v3] linux/uio.h: cleanup for userspace
265
266 Hide iov_shorten() behind __KERNEL__ since it's a prototype only. Use the
267 __inline__ form for iov_length() since it's usable by userspace.
268
269 Signed-off-by: Mike Frysinger <vapier@g.o>
270 ---
271 v3
272 - keep all __KERNEL__ stuff in one place
273 v2
274 - drop inline conversion stuff
275
276 include/linux/uio.h | 4 ++--
277 1 files changed, 2 insertions(+), 2 deletions(-)
278
279 diff --git a/include/linux/uio.h b/include/linux/uio.h
280 index b7fe138..3debd89 100644
281 --- a/include/linux/uio.h
282 +++ b/include/linux/uio.h
283 @@ -26,6 +26,8 @@ struct kvec {
284 size_t iov_len;
285 };
286
287 +unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
288 +
289 #endif
290
291 /*
292 @@ -52,6 +54,4 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
293 return ret;
294 }
295
296 -unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
297 -
298 #endif
299 --
300 1.6.0.6
301
302
303
304
305 1.1 src/patchsets/gentoo-headers/2.6.28/0005-headers_check.pl-disallow-extern-s.patch
306
307 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0005-headers_check.pl-disallow-extern-s.patch?rev=1.1&view=markup
308 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0005-headers_check.pl-disallow-extern-s.patch?rev=1.1&content-type=text/plain
309
310 Index: 0005-headers_check.pl-disallow-extern-s.patch
311 ===================================================================
312 From d75f69d9b5b6cf2db802842acdcca57a80a3685d Mon Sep 17 00:00:00 2001
313 From: Mike Frysinger <vapier@g.o>
314 Date: Sat, 27 Dec 2008 02:37:43 -0500
315 Subject: [PATCH] headers_check.pl: disallow extern's
316
317 Since prototypes with "extern" refer to kernel functions, they make no
318 sense in userspace, so reject them automatically.
319
320 Signed-off-by: Mike Frysinger <vapier@g.o>
321 ---
322 scripts/headers_check.pl | 12 +++++++++++-
323 1 files changed, 11 insertions(+), 1 deletions(-)
324
325 diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
326 index 488a3b1..5bdd975 100644
327 --- a/scripts/headers_check.pl
328 +++ b/scripts/headers_check.pl
329 @@ -14,7 +14,9 @@
330 # Only include files located in asm* and linux* are checked.
331 # The rest are assumed to be system include files.
332 #
333 -# 2) TODO: check for leaked CONFIG_ symbols
334 +# 2) It is checked that prototypes does not use "extern"
335 +#
336 +# 3) TODO: check for leaked CONFIG_ symbols
337
338 use strict;
339
340 @@ -33,6 +35,7 @@ foreach my $file (@files) {
341 while ($line = <FH>) {
342 $lineno++;
343 check_include();
344 + check_prototypes();
345 }
346 close FH;
347 }
348 @@ -54,3 +57,10 @@ sub check_include
349 }
350 }
351 }
352 +
353 +sub check_prototypes
354 +{
355 + if ($line =~ m/^\s*extern\b/) {
356 + printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
357 + }
358 +}
359 --
360 1.6.0.6
361
362
363
364
365 1.1 src/patchsets/gentoo-headers/2.6.28/0006-headers_install.pl-autoconvert-asm-inline-volatile.patch
366
367 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0006-headers_install.pl-autoconvert-asm-inline-volatile.patch?rev=1.1&view=markup
368 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0006-headers_install.pl-autoconvert-asm-inline-volatile.patch?rev=1.1&content-type=text/plain
369
370 Index: 0006-headers_install.pl-autoconvert-asm-inline-volatile.patch
371 ===================================================================
372 From dd2868d21c8b1cdfe7819d49607696a0569d6aa5 Mon Sep 17 00:00:00 2001
373 From: Mike Frysinger <vapier@g.o>
374 Date: Sat, 27 Dec 2008 02:51:32 -0500
375 Subject: [PATCH] headers_install.pl: autoconvert asm/inline/volatile to __xxx__
376
377 Headers in userspace should be using the __xxx__ form of the asm, inline,
378 and volatile keywords. Since people like to revert these things without
379 realizing what's going on, have the headers install step autoconvert these
380 keywords.
381
382 Signed-off-by: Mike Frysinger <vapier@g.o>
383 ---
384 scripts/headers_install.pl | 3 +++
385 1 files changed, 3 insertions(+), 0 deletions(-)
386
387 diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
388 index 7d2b414..c6ae405 100644
389 --- a/scripts/headers_install.pl
390 +++ b/scripts/headers_install.pl
391 @@ -36,6 +36,9 @@ foreach my $file (@files) {
392 $line =~ s/\s__attribute_const__\s/ /g;
393 $line =~ s/\s__attribute_const__$//g;
394 $line =~ s/^#include <linux\/compiler.h>//;
395 + $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
396 + $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
397 + $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
398 printf OUTFILE "%s", $line;
399 }
400 close OUTFILE;
401 --
402 1.6.0.6
403
404
405
406
407 1.1 src/patchsets/gentoo-headers/2.6.28/0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch
408
409 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch?rev=1.1&view=markup
410 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch?rev=1.1&content-type=text/plain
411
412 Index: 0007-linux-serial.h-pull-in-linux-types.h-for-userspace.patch
413 ===================================================================
414 From 04f79d4a95d3656bd7bf45281947eeee46bdf73c Mon Sep 17 00:00:00 2001
415 From: Mike Frysinger <vapier@g.o>
416 Date: Mon, 29 Dec 2008 04:27:02 -0500
417 Subject: [PATCH] linux/serial.h: pull in linux/types.h for userspace
418
419 Since the struct serial_rs485 is exported to userspace and uses __u##,
420 types we need to include linux/types.h for it.
421
422 Signed-off-by: Mike Frysinger <vapier@g.o>
423 ---
424 include/linux/serial.h | 2 +-
425 1 files changed, 1 insertions(+), 1 deletions(-)
426
427 diff --git a/include/linux/serial.h b/include/linux/serial.h
428 index 1ea8d92..fa72b39 100644
429 --- a/include/linux/serial.h
430 +++ b/include/linux/serial.h
431 @@ -10,8 +10,8 @@
432 #ifndef _LINUX_SERIAL_H
433 #define _LINUX_SERIAL_H
434
435 -#ifdef __KERNEL__
436 #include <linux/types.h>
437 +#ifdef __KERNEL__
438 #include <asm/page.h>
439
440 /*
441 --
442 1.6.0.6
443
444
445
446
447 1.1 src/patchsets/gentoo-headers/2.6.28/0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch
448
449 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch?rev=1.1&view=markup
450 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch?rev=1.1&content-type=text/plain
451
452 Index: 0008-kbuild-check-for-leaked-CONFIG_-symbols-to-userspac.patch
453 ===================================================================
454 From 036aac737511413f1ae48342b69564b0ef5aec0c Mon Sep 17 00:00:00 2001
455 From: Sam Ravnborg <sam@××××××××.org>
456 Date: Sat, 27 Dec 2008 19:54:15 +0100
457 Subject: [PATCH] kbuild: check for leaked CONFIG_ symbols to userspace
458
459 Signed-off-by: Sam Ravnborg <sam@××××××××.org>
460 ---
461 scripts/headers_check.pl | 10 +++++++++-
462 1 files changed, 9 insertions(+), 1 deletions(-)
463
464 diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
465 index 5bdd975..bdd9fb6 100644
466 --- a/scripts/headers_check.pl
467 +++ b/scripts/headers_check.pl
468 @@ -16,7 +16,7 @@
469 #
470 # 2) It is checked that prototypes does not use "extern"
471 #
472 -# 3) TODO: check for leaked CONFIG_ symbols
473 +# 3) Check for leaked CONFIG_ symbols
474
475 use strict;
476
477 @@ -36,6 +36,7 @@ foreach my $file (@files) {
478 $lineno++;
479 check_include();
480 check_prototypes();
481 + check_config();
482 }
483 close FH;
484 }
485 @@ -64,3 +65,10 @@ sub check_prototypes
486 printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
487 }
488 }
489 +
490 +sub check_config
491 +{
492 + if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) {
493 + printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n";
494 + }
495 +}
496 --
497 1.6.0.6
498
499
500
501
502 1.1 src/patchsets/gentoo-headers/2.6.28/0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch
503
504 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch?rev=1.1&view=markup
505 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch?rev=1.1&content-type=text/plain
506
507 Index: 0009-kbuild-warn-about-headers-using-__-us-8-16-32-64.patch
508 ===================================================================
509 From 58ffae8a95e580e08be2d8f302fd9fcfca78a3f3 Mon Sep 17 00:00:00 2001
510 From: Mike Frysinger <vapier@g.o>
511 Date: Mon, 29 Dec 2008 05:28:24 -0500
512 Subject: [PATCH] kbuild: warn about headers using __[us]{8,16,32,64} types w/out linux/types.h
513
514 Signed-off-by: Mike Frysinger <vapier@g.o>
515 ---
516 scripts/headers_check.pl | 20 ++++++++++++++++++++
517 1 files changed, 20 insertions(+), 0 deletions(-)
518
519 diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
520 index bdd9fb6..5036319 100644
521 --- a/scripts/headers_check.pl
522 +++ b/scripts/headers_check.pl
523 @@ -37,6 +37,7 @@ foreach my $file (@files) {
524 check_include();
525 check_prototypes();
526 check_config();
527 + check_sizetypes();
528 }
529 close FH;
530 }
531 @@ -72,3 +73,22 @@ sub check_config
532 printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n";
533 }
534 }
535 +
536 +my $linux_types;
537 +sub check_sizetypes
538 +{
539 + if ($lineno == 1) {
540 + $linux_types = 0;
541 + } elsif ($linux_types) {
542 + return;
543 + }
544 + if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
545 + $linux_types = 1;
546 + return;
547 + }
548 + if ($line =~ m/__[us](8|16|32|64)\b/) {
549 + printf STDERR "$filename:$lineno: found __[us]{8,16,32,64} type w/out #include <linux/types.h>\n";
550 + # Warn until headers are all fixed
551 + #$ret = 1;
552 + }
553 +}
554 --
555 1.6.0.6
556
557
558
559
560 1.1 src/patchsets/gentoo-headers/2.6.28/0010-kbuild-auto-convert-size-types-in-userspace-headers.patch
561
562 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0010-kbuild-auto-convert-size-types-in-userspace-headers.patch?rev=1.1&view=markup
563 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0010-kbuild-auto-convert-size-types-in-userspace-headers.patch?rev=1.1&content-type=text/plain
564
565 Index: 0010-kbuild-auto-convert-size-types-in-userspace-headers.patch
566 ===================================================================
567 From f2bf6639442caebb1810b3644b08a7d5236a0837 Mon Sep 17 00:00:00 2001
568 From: Mike Frysinger <vapier@g.o>
569 Date: Mon, 29 Dec 2008 06:07:47 -0500
570 Subject: [PATCH] kbuild: auto-convert size types in userspace headers
571
572 Rather than constantly fixing up size type breakage in userspace headers,
573 auto convert the types u_intXX_t, uintXX_t, intXX_t, uXX, and sXX to the
574 appropriate __uXX or __sXX type.
575
576 Signed-off-by: Mike Frysinger <vapier@g.o>
577 ---
578 scripts/headers_install.pl | 3 +++
579 1 files changed, 3 insertions(+), 0 deletions(-)
580
581 diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
582 index c6ae405..697f02d 100644
583 --- a/scripts/headers_install.pl
584 +++ b/scripts/headers_install.pl
585 @@ -39,6 +39,9 @@ foreach my $file (@files) {
586 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
587 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
588 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
589 + $line =~ s/\b([us](8|16|32|64))\b/__$1/g;
590 + $line =~ s/\b(u_?int(8|16|32|64)_t)\b/__u$2/g;
591 + $line =~ s/\b(int(8|16|32|64)_t)\b/__s$2/g;
592 printf OUTFILE "%s", $line;
593 }
594 close OUTFILE;
595 --
596 1.6.0.6
597
598
599
600
601 1.1 src/patchsets/gentoo-headers/2.6.28/0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch
602
603 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch?rev=1.1&view=markup
604 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch?rev=1.1&content-type=text/plain
605
606 Index: 0011-linux-types.h-export-aligned_-u-be-le-64-macros.patch
607 ===================================================================
608 From 050a1d788a183addd15e5b1e8f0c992588ffc3e5 Mon Sep 17 00:00:00 2001
609 From: Mike Frysinger <vapier@g.o>
610 Date: Mon, 29 Dec 2008 06:51:45 -0500
611 Subject: [PATCH] linux/types.h: export aligned_{u,be,le}64 macros
612
613 Some userspace headers rely on these aligned_* macros and they don't
614 conflict with normal userspace / libc types, so always export them
615 regardless of the define __KERNEL_STRICT_NAMES.
616
617 Signed-off-by: Mike Frysinger <vapier@g.o>
618 ---
619 include/linux/types.h | 10 +++++-----
620 1 files changed, 5 insertions(+), 5 deletions(-)
621
622 diff --git a/include/linux/types.h b/include/linux/types.h
623 index 1d98330..a999d0c 100644
624 --- a/include/linux/types.h
625 +++ b/include/linux/types.h
626 @@ -125,11 +125,6 @@ typedef __u64 u_int64_t;
627 typedef __s64 int64_t;
628 #endif
629
630 -/* this is a special 64bit data type that is 8-byte aligned */
631 -#define aligned_u64 __u64 __attribute__((aligned(8)))
632 -#define aligned_be64 __be64 __attribute__((aligned(8)))
633 -#define aligned_le64 __le64 __attribute__((aligned(8)))
634 -
635 /**
636 * The type used for indexing onto a disc or disc partition.
637 *
638 @@ -161,6 +156,11 @@ typedef unsigned long blkcnt_t;
639
640 #endif /* __KERNEL_STRICT_NAMES */
641
642 +/* this is a special 64bit data type that is 8-byte aligned */
643 +#define aligned_u64 __u64 __attribute__((aligned(8)))
644 +#define aligned_be64 __be64 __attribute__((aligned(8)))
645 +#define aligned_le64 __le64 __attribute__((aligned(8)))
646 +
647 /*
648 * Below are truly Linux-specific types that should never collide with
649 * any application/library that wants linux/types.h.
650 --
651 1.6.0.6
652
653
654
655
656 1.1 src/patchsets/gentoo-headers/2.6.28/0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch
657
658 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch?rev=1.1&view=markup
659 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch?rev=1.1&content-type=text/plain
660
661 Index: 0012-linux-stat-socket-.h-remove-__GLIBC__-checks.patch
662 ===================================================================
663 From d6f760ef3e59257d404b0d0b3c5879a14a95352c Mon Sep 17 00:00:00 2001
664 From: Mike Frysinger <vapier@g.o>
665 Date: Mon, 29 Dec 2008 06:52:59 -0500
666 Subject: [PATCH] linux/{stat,socket}.h: remove __GLIBC__ checks
667
668 Only check __KERNEL__ so we don't assume the C library is glibc.
669
670 Signed-off-by: Mike Frysinger <vapier@g.o>
671 ---
672 include/linux/socket.h | 2 +-
673 include/linux/stat.h | 2 +-
674 2 files changed, 2 insertions(+), 2 deletions(-)
675
676 diff --git a/include/linux/socket.h b/include/linux/socket.h
677 index 20fc4bb..d9b4492 100644
678 --- a/include/linux/socket.h
679 +++ b/include/linux/socket.h
680 @@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
681 /* _SS_MAXSIZE value minus size of ss_family */
682 } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
683
684 -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
685 +#ifdef __KERNEL__
686
687 #include <asm/socket.h> /* arch-dependent defines */
688 #include <linux/sockios.h> /* the SIOCxxx I/O controls */
689 diff --git a/include/linux/stat.h b/include/linux/stat.h
690 index 611c398..5460344 100644
691 --- a/include/linux/stat.h
692 +++ b/include/linux/stat.h
693 @@ -7,7 +7,7 @@
694
695 #endif
696
697 -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
698 +#ifdef __KERNEL__
699
700 #define S_IFMT 00170000
701 #define S_IFSOCK 0140000
702 --
703 1.6.0.6
704
705
706
707
708 1.1 src/patchsets/gentoo-headers/2.6.28/0013-linux-pull-in-other-needed-headers-for-userspace.patch
709
710 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0013-linux-pull-in-other-needed-headers-for-userspace.patch?rev=1.1&view=markup
711 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0013-linux-pull-in-other-needed-headers-for-userspace.patch?rev=1.1&content-type=text/plain
712
713 Index: 0013-linux-pull-in-other-needed-headers-for-userspace.patch
714 ===================================================================
715 From 4746067f2c53a4e84a8003d03c6943302bb11c98 Mon Sep 17 00:00:00 2001
716 From: Mike Frysinger <vapier@g.o>
717 Date: Mon, 29 Dec 2008 07:41:01 -0500
718 Subject: [PATCH] linux/*: pull in other needed headers for userspace
719
720 mondo patch
721
722 Signed-off-by: Mike Frysinger <vapier@g.o>
723 ---
724 include/linux/atalk.h | 1 +
725 include/linux/atm_zatm.h | 1 +
726 include/linux/auto_fs.h | 2 +-
727 include/linux/auto_fs4.h | 2 ++
728 include/linux/bfs_fs.h | 2 ++
729 include/linux/cm4000_cs.h | 3 +++
730 include/linux/dn.h | 3 +++
731 include/linux/efs_fs_sb.h | 1 +
732 include/linux/elfcore.h | 1 -
733 include/linux/errqueue.h | 2 ++
734 include/linux/ext2_fs.h | 1 +
735 include/linux/gfs2_ondisk.h | 2 ++
736 include/linux/hdlc/ioctl.h | 1 +
737 include/linux/hiddev.h | 2 ++
738 include/linux/if_fc.h | 1 +
739 include/linux/if_ppp.h | 3 +++
740 include/linux/if_pppol2tp.h | 5 +----
741 include/linux/if_strip.h | 2 ++
742 include/linux/if_tunnel.h | 2 ++
743 include/linux/inet_diag.h | 2 ++
744 include/linux/ipv6_route.h | 2 ++
745 include/linux/ipx.h | 1 +
746 include/linux/irda.h | 3 +++
747 include/linux/isdn_divertif.h | 1 +
748 include/linux/llc.h | 4 ++++
749 include/linux/minix_fs.h | 1 +
750 include/linux/netfilter/x_tables.h | 2 ++
751 include/linux/netrom.h | 2 ++
752 include/linux/nfs_idmap.h | 2 ++
753 include/linux/nfsd/syscall.h | 6 ++----
754 include/linux/nubus.h | 2 ++
755 include/linux/pkt_cls.h | 1 +
756 include/linux/pkt_sched.h | 2 ++
757 include/linux/ppp_defs.h | 2 ++
758 include/linux/random.h | 1 +
759 include/linux/romfs_fs.h | 2 ++
760 include/linux/rose.h | 3 +++
761 include/linux/scc.h | 1 +
762 include/linux/selinux_netlink.h | 2 ++
763 include/linux/synclink.h | 3 +++
764 include/linux/times.h | 1 +
765 include/linux/un.h | 2 ++
766 include/linux/video_decoder.h | 2 ++
767 include/linux/video_encoder.h | 2 ++
768 include/linux/x25.h | 1 +
769 45 files changed, 80 insertions(+), 10 deletions(-)
770
771 diff --git a/include/linux/atalk.h b/include/linux/atalk.h
772 index e9ebac2..ba61b9f 100644
773 --- a/include/linux/atalk.h
774 +++ b/include/linux/atalk.h
775 @@ -2,6 +2,7 @@
776 #define __LINUX_ATALK_H__
777
778 #include <asm/byteorder.h>
779 +#include <linux/socket.h>
780
781 /*
782 * AppleTalk networking structures
783 diff --git a/include/linux/atm_zatm.h b/include/linux/atm_zatm.h
784 index 10f0fa2..ca03fef 100644
785 --- a/include/linux/atm_zatm.h
786 +++ b/include/linux/atm_zatm.h
787 @@ -12,6 +12,7 @@
788 * sys/types.h for struct timeval
789 */
790
791 +#include <linux/time.h>
792 #include <linux/atmapi.h>
793 #include <linux/atmioc.h>
794
795 diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
796 index c21e597..9a5c539 100644
797 --- a/include/linux/auto_fs.h
798 +++ b/include/linux/auto_fs.h
799 @@ -16,10 +16,10 @@
800
801 #ifdef __KERNEL__
802 #include <linux/fs.h>
803 -#include <linux/limits.h>
804 #include <asm/types.h>
805 #endif /* __KERNEL__ */
806
807 +#include <linux/limits.h>
808 #include <linux/ioctl.h>
809
810 /* This file describes autofs v3 */
811 diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
812 index 2253716..9c46e4c 100644
813 --- a/include/linux/auto_fs4.h
814 +++ b/include/linux/auto_fs4.h
815 @@ -11,6 +11,8 @@
816 #ifndef _LINUX_AUTO_FS4_H
817 #define _LINUX_AUTO_FS4_H
818
819 +#include <linux/types.h>
820 +
821 /* Include common v3 definitions */
822 #include <linux/auto_fs.h>
823
824 diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
825 index 8ed6dfd..2ca3e8f 100644
826 --- a/include/linux/bfs_fs.h
827 +++ b/include/linux/bfs_fs.h
828 @@ -6,6 +6,8 @@
829 #ifndef _LINUX_BFS_FS_H
830 #define _LINUX_BFS_FS_H
831
832 +#include <linux/types.h>
833 +
834 #define BFS_BSIZE_BITS 9
835 #define BFS_BSIZE (1<<BFS_BSIZE_BITS)
836
837 diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
838 index 605ebe2..8d95b2f 100644
839 --- a/include/linux/cm4000_cs.h
840 +++ b/include/linux/cm4000_cs.h
841 @@ -1,6 +1,9 @@
842 #ifndef _CM4000_H_
843 #define _CM4000_H_
844
845 +#include <linux/types.h>
846 +#include <linux/ioctl.h>
847 +
848 #define MAX_ATR 33
849
850 #define CM4000_MAX_DEV 4
851 diff --git a/include/linux/dn.h b/include/linux/dn.h
852 index 02bba04..5b5c587 100644
853 --- a/include/linux/dn.h
854 +++ b/include/linux/dn.h
855 @@ -7,6 +7,9 @@
856
857 */
858
859 +#include <linux/ioctl.h>
860 +#include <linux/types.h>
861 +
862 /*
863 * DNPROTO_NSP can't be the same as SOL_SOCKET,
864 * so increment each by one (compared to ULTRIX)
865 diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h
866 index ff1945e..a742b29 100644
867 --- a/include/linux/efs_fs_sb.h
868 +++ b/include/linux/efs_fs_sb.h
869 @@ -10,6 +10,7 @@
870 #define __EFS_FS_SB_H__
871
872 #include <linux/magic.h>
873 +#include <linux/types.h>
874
875 /* EFS superblock magic numbers */
876 #define EFS_MAGIC 0x072959
877 diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
878 index 5ca54d7..1e9cfca 100644
879 --- a/include/linux/elfcore.h
880 +++ b/include/linux/elfcore.h
881 @@ -24,7 +24,6 @@ struct elf_siginfo
882 typedef elf_greg_t greg_t;
883 typedef elf_gregset_t gregset_t;
884 typedef elf_fpregset_t fpregset_t;
885 -typedef elf_fpxregset_t fpxregset_t;
886 #define NGREG ELF_NGREG
887 #endif
888
889 diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
890 index 92f8d4f..ceb1454 100644
891 --- a/include/linux/errqueue.h
892 +++ b/include/linux/errqueue.h
893 @@ -1,6 +1,8 @@
894 #ifndef _LINUX_ERRQUEUE_H
895 #define _LINUX_ERRQUEUE_H 1
896
897 +#include <linux/types.h>
898 +
899 struct sock_extended_err
900 {
901 __u32 ee_errno;
902 diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
903 index 78c775a..8d5aaa2 100644
904 --- a/include/linux/ext2_fs.h
905 +++ b/include/linux/ext2_fs.h
906 @@ -18,6 +18,7 @@
907
908 #include <linux/types.h>
909 #include <linux/magic.h>
910 +#include <linux/fs.h>
911
912 /*
913 * The second extended filesystem constants/structures
914 diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
915 index 14d0df0..c56b4bc 100644
916 --- a/include/linux/gfs2_ondisk.h
917 +++ b/include/linux/gfs2_ondisk.h
918 @@ -10,6 +10,8 @@
919 #ifndef __GFS2_ONDISK_DOT_H__
920 #define __GFS2_ONDISK_DOT_H__
921
922 +#include <linux/types.h>
923 +
924 #define GFS2_MAGIC 0x01161970
925 #define GFS2_BASIC_BLOCK 512
926 #define GFS2_BASIC_BLOCK_SHIFT 9
927 diff --git a/include/linux/hdlc/ioctl.h b/include/linux/hdlc/ioctl.h
928 index 5839723..79c4ef8 100644
929 --- a/include/linux/hdlc/ioctl.h
930 +++ b/include/linux/hdlc/ioctl.h
931 @@ -1,6 +1,7 @@
932 #ifndef __HDLC_IOCTL_H__
933 #define __HDLC_IOCTL_H__
934
935 +#include <linux/if.h>
936
937 #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
938
939 diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
940 index c760ae0..bb6f58b 100644
941 --- a/include/linux/hiddev.h
942 +++ b/include/linux/hiddev.h
943 @@ -27,6 +27,8 @@
944 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
945 */
946
947 +#include <linux/types.h>
948 +
949 /*
950 * The event structure itself
951 */
952 diff --git a/include/linux/if_fc.h b/include/linux/if_fc.h
953 index 376a34e..6ed7f1b 100644
954 --- a/include/linux/if_fc.h
955 +++ b/include/linux/if_fc.h
956 @@ -20,6 +20,7 @@
957 #ifndef _LINUX_IF_FC_H
958 #define _LINUX_IF_FC_H
959
960 +#include <linux/types.h>
961
962 #define FC_ALEN 6 /* Octets in one ethernet addr */
963 #define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
964 diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
965 index c3b1f85..50f8704 100644
966 --- a/include/linux/if_ppp.h
967 +++ b/include/linux/if_ppp.h
968 @@ -34,6 +34,9 @@
969 #define _IF_PPP_H_
970
971 #include <linux/compiler.h>
972 +#include <linux/if.h>
973 +#include <linux/ppp_defs.h>
974 +#include <linux/types.h>
975
976 /*
977 * Packet sizes
978 diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
979 index a7d6a22..223c09d 100644
980 --- a/include/linux/if_pppol2tp.h
981 +++ b/include/linux/if_pppol2tp.h
982 @@ -15,11 +15,8 @@
983 #ifndef __LINUX_IF_PPPOL2TP_H
984 #define __LINUX_IF_PPPOL2TP_H
985
986 -#include <asm/types.h>
987 -
988 -#ifdef __KERNEL__
989 +#include <linux/types.h>
990 #include <linux/in.h>
991 -#endif
992
993 /* Structure used to connect() the socket to a particular tunnel UDP
994 * socket.
995 diff --git a/include/linux/if_strip.h b/include/linux/if_strip.h
996 index fb5c5c9..6526a62 100644
997 --- a/include/linux/if_strip.h
998 +++ b/include/linux/if_strip.h
999 @@ -18,6 +18,8 @@
1000 #ifndef __LINUX_STRIP_H
1001 #define __LINUX_STRIP_H
1002
1003 +#include <linux/types.h>
1004 +
1005 typedef struct {
1006 __u8 c[6];
1007 } MetricomAddress;
1008 diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
1009 index aeab2cb..edd8799 100644
1010 --- a/include/linux/if_tunnel.h
1011 +++ b/include/linux/if_tunnel.h
1012 @@ -2,6 +2,8 @@
1013 #define _IF_TUNNEL_H_
1014
1015 #include <linux/types.h>
1016 +#include <asm/byteorder.h>
1017 +#include <linux/if.h>
1018 #include <linux/ip.h>
1019
1020 #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
1021 diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
1022 index 6e8bc54..bc8c490 100644
1023 --- a/include/linux/inet_diag.h
1024 +++ b/include/linux/inet_diag.h
1025 @@ -1,6 +1,8 @@
1026 #ifndef _INET_DIAG_H_
1027 #define _INET_DIAG_H_ 1
1028
1029 +#include <linux/types.h>
1030 +
1031 /* Just some random number */
1032 #define TCPDIAG_GETSOCK 18
1033 #define DCCPDIAG_GETSOCK 19
1034 diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
1035 index b323ff5..d5865f0 100644
1036 --- a/include/linux/ipv6_route.h
1037 +++ b/include/linux/ipv6_route.h
1038 @@ -13,6 +13,8 @@
1039 #ifndef _LINUX_IPV6_ROUTE_H
1040 #define _LINUX_IPV6_ROUTE_H
1041
1042 +#include <linux/in6.h>
1043 +
1044 #define RTF_DEFAULT 0x00010000 /* default - learned via ND */
1045 #define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
1046 fallback, no routers on link */
1047 diff --git a/include/linux/ipx.h b/include/linux/ipx.h
1048 index eb19b4e..22d379f 100644
1049 --- a/include/linux/ipx.h
1050 +++ b/include/linux/ipx.h
1051 @@ -2,6 +2,7 @@
1052 #define _IPX_H_
1053 #include <linux/sockios.h>
1054 #include <linux/socket.h>
1055 +#include <linux/types.h>
1056 #define IPX_NODE_LEN 6
1057 #define IPX_MTU 576
1058
1059 diff --git a/include/linux/irda.h b/include/linux/irda.h
1060 index 28f88ec..5073b21 100644
1061 --- a/include/linux/irda.h
1062 +++ b/include/linux/irda.h
1063 @@ -31,6 +31,9 @@
1064 * this one, or preferably to include <net/irda/irda.h> instead.
1065 * Jean II */
1066
1067 +#include <linux/types.h>
1068 +#include <linux/socket.h>
1069 +
1070 /* Hint bit positions for first hint byte */
1071 #define HINT_PNP 0x01
1072 #define HINT_PDA 0x02
1073 diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
1074 index 07821ca..363ab57 100644
1075 --- a/include/linux/isdn_divertif.h
1076 +++ b/include/linux/isdn_divertif.h
1077 @@ -10,6 +10,7 @@
1078 *
1079 */
1080
1081 +#include <linux/types.h>
1082
1083 /***********************************************************/
1084 /* magic value is also used to control version information */
1085 diff --git a/include/linux/llc.h b/include/linux/llc.h
1086 index 7733585..64ac7ed 100644
1087 --- a/include/linux/llc.h
1088 +++ b/include/linux/llc.h
1089 @@ -12,6 +12,10 @@
1090 *
1091 * See the GNU General Public License for more details.
1092 */
1093 +
1094 +#include <linux/if.h>
1095 +#include <linux/socket.h>
1096 +
1097 #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
1098 struct sockaddr_llc {
1099 sa_family_t sllc_family; /* AF_LLC */
1100 diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
1101 index 0e39745..c12bf47 100644
1102 --- a/include/linux/minix_fs.h
1103 +++ b/include/linux/minix_fs.h
1104 @@ -2,6 +2,7 @@
1105 #define _LINUX_MINIX_FS_H
1106
1107 #include <linux/magic.h>
1108 +#include <linux/types.h>
1109
1110 /*
1111 * The minix filesystem constants/structures
1112 diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
1113 index e52ce47..69bd9e0 100644
1114 --- a/include/linux/netfilter/x_tables.h
1115 +++ b/include/linux/netfilter/x_tables.h
1116 @@ -1,6 +1,8 @@
1117 #ifndef _X_TABLES_H
1118 #define _X_TABLES_H
1119
1120 +#include <linux/types.h>
1121 +
1122 #define XT_FUNCTION_MAXNAMELEN 30
1123 #define XT_TABLE_MAXNAMELEN 32
1124
1125 diff --git a/include/linux/netrom.h b/include/linux/netrom.h
1126 index 6939b32..af7313c 100644
1127 --- a/include/linux/netrom.h
1128 +++ b/include/linux/netrom.h
1129 @@ -7,6 +7,8 @@
1130 #ifndef NETROM_KERNEL_H
1131 #define NETROM_KERNEL_H
1132
1133 +#include <linux/ax25.h>
1134 +
1135 #define NETROM_MTU 236
1136
1137 #define NETROM_T1 1
1138 diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
1139 index 15a9f3b..91a1c24 100644
1140 --- a/include/linux/nfs_idmap.h
1141 +++ b/include/linux/nfs_idmap.h
1142 @@ -37,6 +37,8 @@
1143 #ifndef NFS_IDMAP_H
1144 #define NFS_IDMAP_H
1145
1146 +#include <linux/types.h>
1147 +
1148 /* XXX from bits/utmp.h */
1149 #define IDMAP_NAMESZ 128
1150
1151 diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
1152 index 4e43976..4639a89 100644
1153 --- a/include/linux/nfsd/syscall.h
1154 +++ b/include/linux/nfsd/syscall.h
1155 @@ -10,10 +10,8 @@
1156 #define NFSD_SYSCALL_H
1157
1158 #include <asm/types.h>
1159 -#ifdef __KERNEL__
1160 -# include <linux/types.h>
1161 -# include <linux/in.h>
1162 -#endif
1163 +#include <linux/types.h>
1164 +#include <linux/in.h>
1165 #include <linux/posix_types.h>
1166 #include <linux/nfsd/const.h>
1167 #include <linux/nfsd/export.h>
1168 diff --git a/include/linux/nubus.h b/include/linux/nubus.h
1169 index c435507..bd31554 100644
1170 --- a/include/linux/nubus.h
1171 +++ b/include/linux/nubus.h
1172 @@ -12,6 +12,8 @@
1173 #ifndef LINUX_NUBUS_H
1174 #define LINUX_NUBUS_H
1175
1176 +#include <linux/types.h>
1177 +
1178 #ifdef __KERNEL__
1179 #include <asm/nubus.h>
1180 #endif
1181 diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
1182 index 7cf7824..aa4f39f 100644
1183 --- a/include/linux/pkt_cls.h
1184 +++ b/include/linux/pkt_cls.h
1185 @@ -2,6 +2,7 @@
1186 #define __LINUX_PKT_CLS_H
1187
1188 #include <linux/pkt_sched.h>
1189 +#include <linux/types.h>
1190
1191 /* I think i could have done better macros ; for now this is stolen from
1192 * some arch/mips code - jhs
1193 diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
1194 index 5d921fa..41ead7a 100644
1195 --- a/include/linux/pkt_sched.h
1196 +++ b/include/linux/pkt_sched.h
1197 @@ -1,6 +1,8 @@
1198 #ifndef __LINUX_PKT_SCHED_H
1199 #define __LINUX_PKT_SCHED_H
1200
1201 +#include <linux/types.h>
1202 +
1203 /* Logical priority bands not depending on specific packet scheduler.
1204 Every scheduler will map them to real traffic classes, if it has
1205 no more precise mechanism to classify packets.
1206 diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
1207 index 6e8adc7..428017e 100644
1208 --- a/include/linux/ppp_defs.h
1209 +++ b/include/linux/ppp_defs.h
1210 @@ -40,6 +40,8 @@
1211 #ifndef _PPP_DEFS_H_
1212 #define _PPP_DEFS_H_
1213
1214 +#include <linux/types.h>
1215 +
1216 /*
1217 * The basic PPP frame.
1218 */
1219 diff --git a/include/linux/random.h b/include/linux/random.h
1220 index 36f125c..aed58cf 100644
1221 --- a/include/linux/random.h
1222 +++ b/include/linux/random.h
1223 @@ -8,6 +8,7 @@
1224 #define _LINUX_RANDOM_H
1225
1226 #include <linux/ioctl.h>
1227 +#include <linux/types.h>
1228
1229 /* ioctl()'s for the random number generator */
1230
1231 diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h
1232 index e20bbf9..1404f8d 100644
1233 --- a/include/linux/romfs_fs.h
1234 +++ b/include/linux/romfs_fs.h
1235 @@ -1,6 +1,8 @@
1236 #ifndef __LINUX_ROMFS_FS_H
1237 #define __LINUX_ROMFS_FS_H
1238
1239 +#include <linux/types.h>
1240 +
1241 /* The basic structures of the romfs filesystem */
1242
1243 #define ROMBSIZE BLOCK_SIZE
1244 diff --git a/include/linux/rose.h b/include/linux/rose.h
1245 index c7b4b18..5bcbba1 100644
1246 --- a/include/linux/rose.h
1247 +++ b/include/linux/rose.h
1248 @@ -7,6 +7,9 @@
1249 #ifndef ROSE_KERNEL_H
1250 #define ROSE_KERNEL_H
1251
1252 +#include <linux/socket.h>
1253 +#include <linux/ax25.h>
1254 +
1255 #define ROSE_MTU 251
1256
1257 #define ROSE_MAX_DIGIS 6
1258 diff --git a/include/linux/scc.h b/include/linux/scc.h
1259 index 3495bd9..d5916e5 100644
1260 --- a/include/linux/scc.h
1261 +++ b/include/linux/scc.h
1262 @@ -3,6 +3,7 @@
1263 #ifndef _SCC_H
1264 #define _SCC_H
1265
1266 +#include <linux/sockios.h>
1267
1268 /* selection of hardware types */
1269
1270 diff --git a/include/linux/selinux_netlink.h b/include/linux/selinux_netlink.h
1271 index bbf489d..faf9675 100644
1272 --- a/include/linux/selinux_netlink.h
1273 +++ b/include/linux/selinux_netlink.h
1274 @@ -12,6 +12,8 @@
1275 #ifndef _LINUX_SELINUX_NETLINK_H
1276 #define _LINUX_SELINUX_NETLINK_H
1277
1278 +#include <linux/types.h>
1279 +
1280 /* Message types. */
1281 #define SELNL_MSG_BASE 0x10
1282 enum {
1283 diff --git a/include/linux/synclink.h b/include/linux/synclink.h
1284 index c844a22..510c2db 100644
1285 --- a/include/linux/synclink.h
1286 +++ b/include/linux/synclink.h
1287 @@ -11,6 +11,9 @@
1288
1289 #ifndef _SYNCLINK_H_
1290 #define _SYNCLINK_H_
1291 +
1292 +#include <linux/types.h>
1293 +
1294 #define SYNCLINK_H_VERSION 3.6
1295
1296 #define BIT0 0x0001
1297 diff --git a/include/linux/times.h b/include/linux/times.h
1298 index e2d3020..813446f 100644
1299 --- a/include/linux/times.h
1300 +++ b/include/linux/times.h
1301 @@ -2,6 +2,7 @@
1302 #define _LINUX_TIMES_H
1303
1304 #include <linux/types.h>
1305 +#include <linux/time.h>
1306
1307 struct tms {
1308 clock_t tms_utime;
1309 diff --git a/include/linux/un.h b/include/linux/un.h
1310 index 45561c5..77371f5 100644
1311 --- a/include/linux/un.h
1312 +++ b/include/linux/un.h
1313 @@ -1,6 +1,8 @@
1314 #ifndef _LINUX_UN_H
1315 #define _LINUX_UN_H
1316
1317 +#include <linux/socket.h>
1318 +
1319 #define UNIX_PATH_MAX 108
1320
1321 struct sockaddr_un {
1322 diff --git a/include/linux/video_decoder.h b/include/linux/video_decoder.h
1323 index 121e26d..e26c0c8 100644
1324 --- a/include/linux/video_decoder.h
1325 +++ b/include/linux/video_decoder.h
1326 @@ -1,6 +1,8 @@
1327 #ifndef _LINUX_VIDEO_DECODER_H
1328 #define _LINUX_VIDEO_DECODER_H
1329
1330 +#include <linux/types.h>
1331 +
1332 #define HAVE_VIDEO_DECODER 1
1333
1334 struct video_decoder_capability { /* this name is too long */
1335 diff --git a/include/linux/video_encoder.h b/include/linux/video_encoder.h
1336 index 4b0e690..b7b6423 100644
1337 --- a/include/linux/video_encoder.h
1338 +++ b/include/linux/video_encoder.h
1339 @@ -1,6 +1,8 @@
1340 #ifndef _LINUX_VIDEO_ENCODER_H
1341 #define _LINUX_VIDEO_ENCODER_H
1342
1343 +#include <linux/types.h>
1344 +
1345 struct video_encoder_capability { /* this name is too long */
1346 __u32 flags;
1347 #define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */
1348 diff --git a/include/linux/x25.h b/include/linux/x25.h
1349 index d035e4e..00dcc34 100644
1350 --- a/include/linux/x25.h
1351 +++ b/include/linux/x25.h
1352 @@ -12,6 +12,7 @@
1353 #define X25_KERNEL_H
1354
1355 #include <linux/types.h>
1356 +#include <linux/socket.h>
1357
1358 #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
1359 #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
1360 --
1361 1.6.0.6
1362
1363
1364
1365
1366 1.1 src/patchsets/gentoo-headers/2.6.28/0014-HACK-asm-pull-in-C-library-headers.patch
1367
1368 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0014-HACK-asm-pull-in-C-library-headers.patch?rev=1.1&view=markup
1369 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0014-HACK-asm-pull-in-C-library-headers.patch?rev=1.1&content-type=text/plain
1370
1371 Index: 0014-HACK-asm-pull-in-C-library-headers.patch
1372 ===================================================================
1373 From 16aff1c4ce528abf63fa738307224ceb6421fbad Mon Sep 17 00:00:00 2001
1374 From: Mike Frysinger <vapier@g.o>
1375 Date: Mon, 29 Dec 2008 07:39:14 -0500
1376 Subject: [PATCH] HACK: asm/*: pull in C library headers
1377
1378 Pull in the libc versions of these headers so that the proper
1379 userspace defines/typedefs are utilized.
1380
1381 Signed-off-by: Mike Frysinger <vapier@g.o>
1382 ---
1383 include/asm-generic/fcntl.h | 5 +++++
1384 include/asm-generic/siginfo.h | 5 ++++-
1385 2 files changed, 9 insertions(+), 1 deletions(-)
1386
1387 diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
1388 index b847741..ab7fd64 100644
1389 --- a/include/asm-generic/fcntl.h
1390 +++ b/include/asm-generic/fcntl.h
1391 @@ -1,6 +1,11 @@
1392 #ifndef _ASM_GENERIC_FCNTL_H
1393 #define _ASM_GENERIC_FCNTL_H
1394
1395 +/* Pull in fcntl structs from the libc #244470 */
1396 +#include <fcntl.h>
1397 +#define HAVE_ARCH_STRUCT_FLOCK
1398 +#define HAVE_ARCH_STRUCT_FLOCK64
1399 +
1400 #include <linux/types.h>
1401
1402 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
1403 diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
1404 index 9695701..6ec8983 100644
1405 --- a/include/asm-generic/siginfo.h
1406 +++ b/include/asm-generic/siginfo.h
1407 @@ -1,6 +1,10 @@
1408 #ifndef _ASM_GENERIC_SIGINFO_H
1409 #define _ASM_GENERIC_SIGINFO_H
1410
1411 +#ifndef __KERNEL__
1412 +# include <signal.h>
1413 +#else
1414 +
1415 #include <linux/compiler.h>
1416 #include <linux/types.h>
1417
1418 @@ -269,7 +273,6 @@ typedef struct sigevent {
1419 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
1420 #define sigev_notify_thread_id _sigev_un._tid
1421
1422 -#ifdef __KERNEL__
1423
1424 struct siginfo;
1425 void do_schedule_next_timer(struct siginfo *info);
1426 --
1427 1.6.0.6
1428
1429
1430
1431
1432 1.1 src/patchsets/gentoo-headers/2.6.28/0015-HACK-linux-pull-in-C-library-headers.patch
1433
1434 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0015-HACK-linux-pull-in-C-library-headers.patch?rev=1.1&view=markup
1435 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gentoo-headers/2.6.28/0015-HACK-linux-pull-in-C-library-headers.patch?rev=1.1&content-type=text/plain
1436
1437 Index: 0015-HACK-linux-pull-in-C-library-headers.patch
1438 ===================================================================
1439 From 958b7b63cb221eec91fa25a6aa884eb14341f3a6 Mon Sep 17 00:00:00 2001
1440 From: Mike Frysinger <vapier@g.o>
1441 Date: Mon, 29 Dec 2008 07:40:08 -0500
1442 Subject: [PATCH] HACK: linux/*: pull in C library headers
1443
1444 pull in the libc versions of these headers so that the proper userspace
1445 defines/typedefs are utilized.
1446
1447 the trouble here is that some of the linux/ headers define structs that the
1448 libc net/ headers define (like the if.h header). we cannot simply say
1449 "your program should not include linux/if.h when using net/if.h" because some
1450 of the other linux/ headers may correctly be utilized with net/if.h but they
1451 correctly include linux/if.h. we also cannot say "just use the linux/ headers
1452 and not the libc net/ headers" because the libc headers include more
1453 definitions than its kernel equivalent.
1454
1455 since there is no obvious (at least to me) answer here, we hack the linux/
1456 headers to simply pull in userspace headers and ignore the linux/ ones
1457 completely. this seems to give a proper clean userspace experience.
1458
1459 Signed-off-by: Mike Frysinger <vapier@g.o>
1460 ---
1461 include/linux/cdrom.h | 4 +++
1462 include/linux/if.h | 8 +++--
1463 include/linux/in.h | 66 ++++++++++++++++++++++++++++++++++++++++-------
1464 include/linux/in6.h | 11 +++----
1465 include/linux/ip.h | 3 +-
1466 include/linux/socket.h | 5 +++
1467 include/linux/stat.h | 4 +++
1468 include/linux/time.h | 6 ++++
1469 include/linux/types.h | 1 +
1470 9 files changed, 88 insertions(+), 20 deletions(-)
1471
1472 diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
1473 index 0b49e08..257a03d 100644
1474 --- a/include/linux/cdrom.h
1475 +++ b/include/linux/cdrom.h
1476 @@ -11,6 +11,10 @@
1477 #ifndef _LINUX_CDROM_H
1478 #define _LINUX_CDROM_H
1479
1480 +#ifndef __KERNEL__
1481 +# include <limits.h>
1482 +#endif
1483 +
1484 #include <asm/byteorder.h>
1485
1486 /*******************************************************
1487 diff --git a/include/linux/if.h b/include/linux/if.h
1488 index 6524684..0ef24c6 100644
1489 --- a/include/linux/if.h
1490 +++ b/include/linux/if.h
1491 @@ -19,6 +19,8 @@
1492 #ifndef _LINUX_IF_H
1493 #define _LINUX_IF_H
1494
1495 +#include <net/if.h>
1496 +
1497 #include <linux/types.h> /* for "__kernel_caddr_t" et al */
1498 #include <linux/socket.h> /* for "struct sockaddr" et al */
1499 #include <linux/compiler.h> /* for "__user" et al */
1500 @@ -120,7 +122,7 @@ enum {
1501 * being very small might be worth keeping for clean configuration.
1502 */
1503
1504 -struct ifmap
1505 +struct __kernel_ifmap
1506 {
1507 unsigned long mem_start;
1508 unsigned long mem_end;
1509 @@ -156,7 +158,7 @@ struct if_settings
1510 * remainder may be interface specific.
1511 */
1512
1513 -struct ifreq
1514 +struct __kernel_ifreq
1515 {
1516 #define IFHWADDRLEN 6
1517 union
1518 @@ -206,7 +208,7 @@ struct ifreq
1519 * must know all networks accessible).
1520 */
1521
1522 -struct ifconf
1523 +struct __kernel_ifconf
1524 {
1525 int ifc_len; /* size of buffer */
1526 union
1527 diff --git a/include/linux/in.h b/include/linux/in.h
1528 index db458be..c7643a7 100644
1529 --- a/include/linux/in.h
1530 +++ b/include/linux/in.h
1531 @@ -18,42 +18,88 @@
1532 #ifndef _LINUX_IN_H
1533 #define _LINUX_IN_H
1534
1535 +#include <netinet/in.h>
1536 +
1537 #include <linux/types.h>
1538 #include <linux/socket.h>
1539
1540 /* Standard well-defined IP protocols. */
1541 enum {
1542 +#ifndef IPPROTO_IP
1543 IPPROTO_IP = 0, /* Dummy protocol for TCP */
1544 +#endif
1545 +#ifndef IPPROTO_ICMP
1546 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
1547 +#endif
1548 +#ifndef IPPROTO_IGMP
1549 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
1550 +#endif
1551 +#ifndef IPPROTO_IPIP
1552 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
1553 +#endif
1554 +#ifndef IPPROTO_TCP
1555 IPPROTO_TCP = 6, /* Transmission Control Protocol */
1556 +#endif
1557 +#ifndef IPPROTO_EGP
1558 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
1559 +#endif
1560 +#ifndef IPPROTO_PUP
1561 IPPROTO_PUP = 12, /* PUP protocol */
1562 +#endif
1563 +#ifndef IPPROTO_UDP
1564 IPPROTO_UDP = 17, /* User Datagram Protocol */
1565 +#endif
1566 +#ifndef IPPROTO_IDP
1567 IPPROTO_IDP = 22, /* XNS IDP protocol */
1568 +#endif
1569 +#ifndef IPPROTO_DCCP
1570 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
1571 +#endif
1572 +#ifndef IPPROTO_RSVP
1573 IPPROTO_RSVP = 46, /* RSVP protocol */
1574 +#endif
1575 +#ifndef IPPROTO_GRE
1576 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
1577 +#endif
1578
1579 +#ifndef IPPROTO_IPV6
1580 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
1581 +#endif
1582
1583 +#ifndef IPPROTO_ESP
1584 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
1585 +#endif
1586 +#ifndef IPPROTO_AH
1587 IPPROTO_AH = 51, /* Authentication Header protocol */
1588 +#endif
1589 +#ifndef IPPROTO_BEETPH
1590 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
1591 +#endif
1592 +#ifndef IPPROTO_PIM
1593 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
1594 +#endif
1595
1596 +#ifndef IPPROTO_COMP
1597 IPPROTO_COMP = 108, /* Compression Header protocol */
1598 +#endif
1599 +#ifndef IPPROTO_SCTP
1600 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
1601 +#endif
1602 +#ifndef IPPROTO_UDPLITE
1603 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
1604 +#endif
1605
1606 +#ifndef IPPROTO_RAW
1607 IPPROTO_RAW = 255, /* Raw IP packets */
1608 +#endif
1609 +#if 0
1610 IPPROTO_MAX
1611 +#endif
1612 };
1613
1614
1615 /* Internet address. */
1616 -struct in_addr {
1617 +struct __kernel_in_addr {
1618 __be32 s_addr;
1619 };
1620
1621 @@ -113,26 +159,26 @@ struct in_addr {
1622
1623 /* Request struct for multicast socket ops */
1624
1625 -struct ip_mreq
1626 +struct __kernel_ip_mreq
1627 {
1628 struct in_addr imr_multiaddr; /* IP multicast address of group */
1629 struct in_addr imr_interface; /* local IP address of interface */
1630 };
1631
1632 -struct ip_mreqn
1633 +struct __kernel_ip_mreqn
1634 {
1635 struct in_addr imr_multiaddr; /* IP multicast address of group */
1636 struct in_addr imr_address; /* local IP address of interface */
1637 int imr_ifindex; /* Interface index */
1638 };
1639
1640 -struct ip_mreq_source {
1641 +struct __kernel_ip_mreq_source {
1642 __be32 imr_multiaddr;
1643 __be32 imr_interface;
1644 __be32 imr_sourceaddr;
1645 };
1646
1647 -struct ip_msfilter {
1648 +struct __kernel_ip_msfilter {
1649 __be32 imsf_multiaddr;
1650 __be32 imsf_interface;
1651 __u32 imsf_fmode;
1652 @@ -144,20 +190,20 @@ struct ip_msfilter {
1653 (sizeof(struct ip_msfilter) - sizeof(__u32) \
1654 + (numsrc) * sizeof(__u32))
1655
1656 -struct group_req
1657 +struct __kernel_group_req
1658 {
1659 __u32 gr_interface; /* interface index */
1660 struct __kernel_sockaddr_storage gr_group; /* group address */
1661 };
1662
1663 -struct group_source_req
1664 +struct __kernel_group_source_req
1665 {
1666 __u32 gsr_interface; /* interface index */
1667 struct __kernel_sockaddr_storage gsr_group; /* group address */
1668 struct __kernel_sockaddr_storage gsr_source; /* source address */
1669 };
1670
1671 -struct group_filter
1672 +struct __kernel_group_filter
1673 {
1674 __u32 gf_interface; /* interface index */
1675 struct __kernel_sockaddr_storage gf_group; /* multicast address */
1676 @@ -170,7 +216,7 @@ struct group_filter
1677 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
1678 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
1679
1680 -struct in_pktinfo
1681 +struct __kernel_in_pktinfo
1682 {
1683 int ipi_ifindex;
1684 struct in_addr ipi_spec_dst;
1685 @@ -179,7 +225,7 @@ struct in_pktinfo
1686
1687 /* Structure describing an Internet (IP) socket address. */
1688 #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
1689 -struct sockaddr_in {
1690 +struct __kernel_sockaddr_in {
1691 sa_family_t sin_family; /* Address family */
1692 __be16 sin_port; /* Port number */
1693 struct in_addr sin_addr; /* Internet address */
1694 diff --git a/include/linux/in6.h b/include/linux/in6.h
1695 index bc49204..28c949c 100644
1696 --- a/include/linux/in6.h
1697 +++ b/include/linux/in6.h
1698 @@ -21,13 +21,15 @@
1699 #ifndef _LINUX_IN6_H
1700 #define _LINUX_IN6_H
1701
1702 +#include <netinet/in.h>
1703 +
1704 #include <linux/types.h>
1705
1706 /*
1707 * IPv6 address structure
1708 */
1709
1710 -struct in6_addr
1711 +struct __kernel_in6_addr
1712 {
1713 union
1714 {
1715 @@ -35,9 +37,6 @@ struct in6_addr
1716 __be16 u6_addr16[8];
1717 __be32 u6_addr32[4];
1718 } in6_u;
1719 -#define s6_addr in6_u.u6_addr8
1720 -#define s6_addr16 in6_u.u6_addr16
1721 -#define s6_addr32 in6_u.u6_addr32
1722 };
1723
1724 /* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
1725 @@ -57,7 +56,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
1726 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
1727 #endif
1728
1729 -struct sockaddr_in6 {
1730 +struct __kernel_sockaddr_in6 {
1731 unsigned short int sin6_family; /* AF_INET6 */
1732 __be16 sin6_port; /* Transport layer port # */
1733 __be32 sin6_flowinfo; /* IPv6 flow information */
1734 @@ -65,7 +64,7 @@ struct sockaddr_in6 {
1735 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
1736 };
1737
1738 -struct ipv6_mreq {
1739 +struct __kernel_ipv6_mreq {
1740 /* IPv6 multicast address of group */
1741 struct in6_addr ipv6mr_multiaddr;
1742
1743 diff --git a/include/linux/ip.h b/include/linux/ip.h
1744 index bd0a2a8..19619cc 100644
1745 --- a/include/linux/ip.h
1746 +++ b/include/linux/ip.h
1747 @@ -16,6 +16,7 @@
1748 */
1749 #ifndef _LINUX_IP_H
1750 #define _LINUX_IP_H
1751 +#include <netinet/ip.h>
1752 #include <linux/types.h>
1753 #include <asm/byteorder.h>
1754
1755 @@ -82,7 +83,7 @@
1756
1757 #define IPV4_BEET_PHMAXLEN 8
1758
1759 -struct iphdr {
1760 +struct __kernel_iphdr {
1761 #if defined(__LITTLE_ENDIAN_BITFIELD)
1762 __u8 ihl:4,
1763 version:4;
1764 diff --git a/include/linux/socket.h b/include/linux/socket.h
1765 index d9b4492..1c6c14c 100644
1766 --- a/include/linux/socket.h
1767 +++ b/include/linux/socket.h
1768 @@ -319,4 +319,9 @@ extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
1769
1770 #endif
1771 #endif /* not kernel and not glibc */
1772 +
1773 +#ifndef __KERNEL__
1774 +# include <sys/socket.h>
1775 +#endif
1776 +
1777 #endif /* _LINUX_SOCKET_H */
1778 diff --git a/include/linux/stat.h b/include/linux/stat.h
1779 index 5460344..a90fdb2 100644
1780 --- a/include/linux/stat.h
1781 +++ b/include/linux/stat.h
1782 @@ -77,4 +77,8 @@ struct kstat {
1783
1784 #endif
1785
1786 +#ifndef __KERNEL__
1787 +# include <sys/stat.h>
1788 +#endif
1789 +
1790 #endif
1791 diff --git a/include/linux/time.h b/include/linux/time.h
1792 index ce321ac..f0f9347 100644
1793 --- a/include/linux/time.h
1794 +++ b/include/linux/time.h
1795 @@ -1,4 +1,10 @@
1796 #ifndef _LINUX_TIME_H
1797 +# include <time.h>
1798 +# include <sys/time.h>
1799 +# define _LINUX_TIME_H
1800 +#endif
1801 +
1802 +#ifndef _LINUX_TIME_H
1803 #define _LINUX_TIME_H
1804
1805 #include <linux/types.h>
1806 diff --git a/include/linux/types.h b/include/linux/types.h
1807 index a999d0c..8a2be87 100644
1808 --- a/include/linux/types.h
1809 +++ b/include/linux/types.h
1810 @@ -8,6 +8,7 @@
1811
1812 #endif
1813
1814 +#include <sys/types.h>
1815 #include <linux/posix_types.h>
1816 #include <asm/types.h>
1817
1818 --
1819 1.6.0.6