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.34: 0001-kbuild-auto-convert-size-types-in-userspace-headers.patch 0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch 0003-linux-stat.h-remove-__GLIBC__-checks.patch 0004-linux-stddef.h-export-offsetof-to-userspace.patch 0005-linux-pull-in-other-needed-headers-for-userspace.patch 0006-HACK-asm-pull-in-C-library-headers.patch 0007-HACK-linux-pull-in-C-library-headers.patch 0008-netfilter-pull-in-limits.h.patch 0009-convert-PAGE_SIZE-usage.patch
Date: Fri, 25 Jun 2010 22:01:40
Message-Id: 20100625220136.19F0F2CF69@corvid.gentoo.org
1 vapier 10/06/25 22:01:35
2
3 Added:
4 0001-kbuild-auto-convert-size-types-in-userspace-headers.patch
5 0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch
6 0003-linux-stat.h-remove-__GLIBC__-checks.patch
7 0004-linux-stddef.h-export-offsetof-to-userspace.patch
8 0005-linux-pull-in-other-needed-headers-for-userspace.patch
9 0006-HACK-asm-pull-in-C-library-headers.patch
10 0007-HACK-linux-pull-in-C-library-headers.patch
11 0008-netfilter-pull-in-limits.h.patch
12 0009-convert-PAGE_SIZE-usage.patch
13 Log:
14 initial 2.6.34 patchset based on last 2.6.33 patchset
15
16 Revision Changes Path
17 1.1 src/patchsets/gentoo-headers/2.6.34/0001-kbuild-auto-convert-size-types-in-userspace-headers.patch
18
19 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0001-kbuild-auto-convert-size-types-in-userspace-headers.patch?rev=1.1&view=markup
20 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0001-kbuild-auto-convert-size-types-in-userspace-headers.patch?rev=1.1&content-type=text/plain
21
22 Index: 0001-kbuild-auto-convert-size-types-in-userspace-headers.patch
23 ===================================================================
24 From ed97b15732e8510935902936f37153656b837d19 Mon Sep 17 00:00:00 2001
25 From: Mike Frysinger <vapier@g.o>
26 Date: Mon, 29 Dec 2008 06:07:47 -0500
27 Subject: [PATCH 1/9] kbuild: auto-convert size types in userspace headers
28
29 Rather than constantly fixing up size type breakage in userspace headers,
30 auto convert the types u_intXX_t, uintXX_t, intXX_t, uXX, and sXX to the
31 appropriate __uXX or __sXX type.
32
33 Signed-off-by: Mike Frysinger <vapier@g.o>
34 ---
35 scripts/headers_install.pl | 3 +++
36 1 files changed, 3 insertions(+), 0 deletions(-)
37
38 diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
39 index b89ca2c..050f49c 100644
40 --- a/scripts/headers_install.pl
41 +++ b/scripts/headers_install.pl
42 @@ -39,6 +39,9 @@ foreach my $file (@files) {
43 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
44 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
45 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
46 + $line =~ s/\b([us](8|16|32|64))\b/__$1/g;
47 + $line =~ s/\b(u_?int(8|16|32|64)_t)\b/__u$2/g;
48 + $line =~ s/\b(int(8|16|32|64)_t)\b/__s$2/g;
49 printf OUTFILE "%s", $line;
50 }
51 close OUTFILE;
52 --
53 1.7.1
54
55
56
57
58 1.1 src/patchsets/gentoo-headers/2.6.34/0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch
59
60 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch?rev=1.1&view=markup
61 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch?rev=1.1&content-type=text/plain
62
63 Index: 0002-linux-types.h-create-userspace-safe-64bit-aligned-de.patch
64 ===================================================================
65 From ad0a08cad1fed72999fdb4efdcc5586a220af29e Mon Sep 17 00:00:00 2001
66 From: Mike Frysinger <vapier@g.o>
67 Date: Mon, 29 Dec 2008 06:51:45 -0500
68 Subject: [PATCH 2/9] linux/types.h: create userspace safe 64bit aligned defines
69
70 Some kernel headers exported to userspace rely on these 64bit aligned
71 defines. However, they are hidden behind __KERNEL_STRICT_NAMES at the
72 moment which means most of the time, they're never actually available.
73 These these defines dont actually conflict with normal userspace / C
74 library types, there's no reason to hide them behind the
75 __KERNEL_STRICT_NAMES define.
76
77 Signed-off-by: Mike Frysinger <vapier@g.o>
78 Cc: Sam Ravnborg <sam@××××××××.org>
79 Cc: David Woodhouse <dwmw2@×××××××××.org>
80 Cc: Jan Engelhardt <jengelh@××××××××××××.de>
81 Cc: Patrick McHardy <kaber@×××××.net>
82 Cc: David S. Miller <davem@×××××××××.net>
83 Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
84 ---
85 include/linux/if_ppp.h | 16 ++++++++--------
86 include/linux/netfilter/nfnetlink_log.h | 4 ++--
87 include/linux/netfilter/nfnetlink_queue.h | 4 ++--
88 include/linux/netfilter/xt_connbytes.h | 4 ++--
89 include/linux/netfilter/xt_quota.h | 2 +-
90 include/linux/types.h | 14 +++++++++-----
91 6 files changed, 24 insertions(+), 20 deletions(-)
92
93 diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
94 index fcef103..c9ad383 100644
95 --- a/include/linux/if_ppp.h
96 +++ b/include/linux/if_ppp.h
97 @@ -114,14 +114,14 @@ struct pppol2tp_ioc_stats {
98 __u16 tunnel_id; /* redundant */
99 __u16 session_id; /* if zero, get tunnel stats */
100 __u32 using_ipsec:1; /* valid only for session_id == 0 */
101 - aligned_u64 tx_packets;
102 - aligned_u64 tx_bytes;
103 - aligned_u64 tx_errors;
104 - aligned_u64 rx_packets;
105 - aligned_u64 rx_bytes;
106 - aligned_u64 rx_seq_discards;
107 - aligned_u64 rx_oos_packets;
108 - aligned_u64 rx_errors;
109 + __aligned_u64 tx_packets;
110 + __aligned_u64 tx_bytes;
111 + __aligned_u64 tx_errors;
112 + __aligned_u64 rx_packets;
113 + __aligned_u64 rx_bytes;
114 + __aligned_u64 rx_seq_discards;
115 + __aligned_u64 rx_oos_packets;
116 + __aligned_u64 rx_errors;
117 };
118
119 #define ifr__name b.ifr_ifrn.ifrn_name
120 diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
121 index d3bab7a..1c37f87 100644
122 --- a/include/linux/netfilter/nfnetlink_log.h
123 +++ b/include/linux/netfilter/nfnetlink_log.h
124 @@ -28,8 +28,8 @@ struct nfulnl_msg_packet_hw {
125 };
126
127 struct nfulnl_msg_packet_timestamp {
128 - aligned_be64 sec;
129 - aligned_be64 usec;
130 + __aligned_be64 sec;
131 + __aligned_be64 usec;
132 };
133
134 enum nfulnl_attr_type {
135 diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
136 index 2455fe5..af94e00 100644
137 --- a/include/linux/netfilter/nfnetlink_queue.h
138 +++ b/include/linux/netfilter/nfnetlink_queue.h
139 @@ -25,8 +25,8 @@ struct nfqnl_msg_packet_hw {
140 };
141
142 struct nfqnl_msg_packet_timestamp {
143 - aligned_be64 sec;
144 - aligned_be64 usec;
145 + __aligned_be64 sec;
146 + __aligned_be64 usec;
147 };
148
149 enum nfqnl_attr_type {
150 diff --git a/include/linux/netfilter/xt_connbytes.h b/include/linux/netfilter/xt_connbytes.h
151 index 92fcbb0..f1d6c15 100644
152 --- a/include/linux/netfilter/xt_connbytes.h
153 +++ b/include/linux/netfilter/xt_connbytes.h
154 @@ -17,8 +17,8 @@ enum xt_connbytes_direction {
155
156 struct xt_connbytes_info {
157 struct {
158 - aligned_u64 from; /* count to be matched */
159 - aligned_u64 to; /* count to be matched */
160 + __aligned_u64 from; /* count to be matched */
161 + __aligned_u64 to; /* count to be matched */
162 } count;
163 __u8 what; /* ipt_connbytes_what */
164 __u8 direction; /* ipt_connbytes_direction */
165 diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
166 index 8dc89df..417ab17 100644
167 --- a/include/linux/netfilter/xt_quota.h
168 +++ b/include/linux/netfilter/xt_quota.h
169 @@ -13,7 +13,7 @@ struct xt_quota_info {
170 u_int32_t pad;
171
172 /* Used internally by the kernel */
173 - aligned_u64 quota;
174 + __aligned_u64 quota;
175 struct xt_quota_priv *master;
176 };
177
178 diff --git a/include/linux/types.h b/include/linux/types.h
179 index c42724f..7a13ab4 100644
180 --- a/include/linux/types.h
181 +++ b/include/linux/types.h
182 @@ -118,11 +118,6 @@ typedef __u64 u_int64_t;
183 typedef __s64 int64_t;
184 #endif
185
186 -/* this is a special 64bit data type that is 8-byte aligned */
187 -#define aligned_u64 __u64 __attribute__((aligned(8)))
188 -#define aligned_be64 __be64 __attribute__((aligned(8)))
189 -#define aligned_le64 __le64 __attribute__((aligned(8)))
190 -
191 /**
192 * The type used for indexing onto a disc or disc partition.
193 *
194 @@ -147,8 +142,17 @@ typedef unsigned long blkcnt_t;
195 #define pgoff_t unsigned long
196 #endif
197
198 +#define aligned_u64 __aligned_u64
199 +#define aligned_be64 __aligned_be64
200 +#define aligned_le64 __aligned_le64
201 +
202 #endif /* __KERNEL__ */
203
204 +/* this is a special 64bit data type that is 8-byte aligned */
205 +#define __aligned_u64 __u64 __attribute__((aligned(8)))
206 +#define __aligned_be64 __be64 __attribute__((aligned(8)))
207 +#define __aligned_le64 __le64 __attribute__((aligned(8)))
208 +
209 /*
210 * Below are truly Linux-specific types that should never collide with
211 * any application/library that wants linux/types.h.
212 --
213 1.7.1
214
215
216
217
218 1.1 src/patchsets/gentoo-headers/2.6.34/0003-linux-stat.h-remove-__GLIBC__-checks.patch
219
220 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0003-linux-stat.h-remove-__GLIBC__-checks.patch?rev=1.1&view=markup
221 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0003-linux-stat.h-remove-__GLIBC__-checks.patch?rev=1.1&content-type=text/plain
222
223 Index: 0003-linux-stat.h-remove-__GLIBC__-checks.patch
224 ===================================================================
225 From 01b0bd5aa47159218560c14fa1cd1faf038a8dd8 Mon Sep 17 00:00:00 2001
226 From: Mike Frysinger <vapier@g.o>
227 Date: Mon, 29 Dec 2008 06:52:59 -0500
228 Subject: [PATCH 3/9] linux/stat.h: remove __GLIBC__ checks
229
230 Only check __KERNEL__ so we don't assume the C library is glibc.
231
232 Signed-off-by: Mike Frysinger <vapier@g.o>
233 ---
234 include/linux/stat.h | 2 +-
235 1 files changed, 1 insertions(+), 1 deletions(-)
236
237 diff --git a/include/linux/stat.h b/include/linux/stat.h
238 index 611c398..5460344 100644
239 --- a/include/linux/stat.h
240 +++ b/include/linux/stat.h
241 @@ -7,7 +7,7 @@
242
243 #endif
244
245 -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
246 +#ifdef __KERNEL__
247
248 #define S_IFMT 00170000
249 #define S_IFSOCK 0140000
250 --
251 1.7.1
252
253
254
255
256 1.1 src/patchsets/gentoo-headers/2.6.34/0004-linux-stddef.h-export-offsetof-to-userspace.patch
257
258 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0004-linux-stddef.h-export-offsetof-to-userspace.patch?rev=1.1&view=markup
259 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0004-linux-stddef.h-export-offsetof-to-userspace.patch?rev=1.1&content-type=text/plain
260
261 Index: 0004-linux-stddef.h-export-offsetof-to-userspace.patch
262 ===================================================================
263 From 008fb3fb9702276fa35c6bebdb310dd20b541ee9 Mon Sep 17 00:00:00 2001
264 From: Mike Frysinger <vapier@g.o>
265 Date: Fri, 2 Jan 2009 02:34:03 -0500
266 Subject: [PATCH 4/9] linux/stddef.h: export offsetof() to userspace
267
268 Some userspace headers (like fuse.h) utilize the offsetof() macro. Some
269 userspace packages (like lkcd) expect linux/stddef.h to provide this as
270 well.
271
272 Signed-off-by: Mike Frysinger <vapier@g.o>
273 ---
274 include/linux/stddef.h | 7 +++++--
275 1 files changed, 5 insertions(+), 2 deletions(-)
276
277 diff --git a/include/linux/stddef.h b/include/linux/stddef.h
278 index 6a40c76..4894d59 100644
279 --- a/include/linux/stddef.h
280 +++ b/include/linux/stddef.h
281 @@ -20,9 +20,12 @@ enum {
282 #undef offsetof
283 #ifdef __compiler_offsetof
284 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
285 -#else
286 -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
287 #endif
288 #endif /* __KERNEL__ */
289
290 +#include <stddef.h> /* newer gcc includes this */
291 +#ifndef offsetof
292 +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
293 +#endif
294 +
295 #endif
296 --
297 1.7.1
298
299
300
301
302 1.1 src/patchsets/gentoo-headers/2.6.34/0005-linux-pull-in-other-needed-headers-for-userspace.patch
303
304 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0005-linux-pull-in-other-needed-headers-for-userspace.patch?rev=1.1&view=markup
305 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0005-linux-pull-in-other-needed-headers-for-userspace.patch?rev=1.1&content-type=text/plain
306
307 Index: 0005-linux-pull-in-other-needed-headers-for-userspace.patch
308 ===================================================================
309 From 42af3b1e515e803c3c0274640ee1a930a9a58998 Mon Sep 17 00:00:00 2001
310 From: Mike Frysinger <vapier@g.o>
311 Date: Mon, 29 Dec 2008 07:41:01 -0500
312 Subject: [PATCH 5/9] linux/*: pull in other needed headers for userspace
313
314 mondo patch
315
316 Signed-off-by: Mike Frysinger <vapier@g.o>
317 ---
318 include/linux/atalk.h | 1 +
319 include/linux/atm_zatm.h | 1 +
320 include/linux/cm4000_cs.h | 1 +
321 include/linux/dn.h | 1 +
322 include/linux/elfcore.h | 1 -
323 include/linux/ext2_fs.h | 1 +
324 include/linux/if_ppp.h | 2 ++
325 include/linux/if_pppol2tp.h | 3 ---
326 include/linux/if_tunnel.h | 4 +---
327 include/linux/ipv6_route.h | 1 +
328 include/linux/irda.h | 1 +
329 include/linux/llc.h | 4 ++++
330 include/linux/netrom.h | 2 ++
331 include/linux/nfsd/syscall.h | 1 +
332 include/linux/romfs_fs.h | 2 ++
333 include/linux/rose.h | 3 +++
334 include/linux/scc.h | 1 +
335 include/linux/times.h | 1 +
336 include/linux/un.h | 2 ++
337 include/linux/x25.h | 1 +
338 20 files changed, 27 insertions(+), 7 deletions(-)
339
340 diff --git a/include/linux/atalk.h b/include/linux/atalk.h
341 index d34c187..a2ce5e7 100644
342 --- a/include/linux/atalk.h
343 +++ b/include/linux/atalk.h
344 @@ -3,6 +3,7 @@
345
346 #include <linux/types.h>
347 #include <asm/byteorder.h>
348 +#include <linux/socket.h>
349
350 /*
351 * AppleTalk networking structures
352 diff --git a/include/linux/atm_zatm.h b/include/linux/atm_zatm.h
353 index 10f0fa2..ca03fef 100644
354 --- a/include/linux/atm_zatm.h
355 +++ b/include/linux/atm_zatm.h
356 @@ -12,6 +12,7 @@
357 * sys/types.h for struct timeval
358 */
359
360 +#include <linux/time.h>
361 #include <linux/atmapi.h>
362 #include <linux/atmioc.h>
363
364 diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
365 index 72bfefd..b179b68 100644
366 --- a/include/linux/cm4000_cs.h
367 +++ b/include/linux/cm4000_cs.h
368 @@ -2,6 +2,7 @@
369 #define _CM4000_H_
370
371 #include <linux/types.h>
372 +#include <linux/ioctl.h>
373
374 #define MAX_ATR 33
375
376 diff --git a/include/linux/dn.h b/include/linux/dn.h
377 index 9c50445..dc9f005 100644
378 --- a/include/linux/dn.h
379 +++ b/include/linux/dn.h
380 @@ -1,6 +1,7 @@
381 #ifndef _LINUX_DN_H
382 #define _LINUX_DN_H
383
384 +#include <linux/ioctl.h>
385 #include <linux/types.h>
386
387 /*
388 diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
389 index e687bc3..8baec07 100644
390 --- a/include/linux/elfcore.h
391 +++ b/include/linux/elfcore.h
392 @@ -26,7 +26,6 @@ struct elf_siginfo
393 typedef elf_greg_t greg_t;
394 typedef elf_gregset_t gregset_t;
395 typedef elf_fpregset_t fpregset_t;
396 -typedef elf_fpxregset_t fpxregset_t;
397 #define NGREG ELF_NGREG
398 #endif
399
400 diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
401 index 2dfa707..53792bf 100644
402 --- a/include/linux/ext2_fs.h
403 +++ b/include/linux/ext2_fs.h
404 @@ -18,6 +18,7 @@
405
406 #include <linux/types.h>
407 #include <linux/magic.h>
408 +#include <linux/fs.h>
409
410 /*
411 * The second extended filesystem constants/structures
412 diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
413 index c9ad383..22ebbc1 100644
414 --- a/include/linux/if_ppp.h
415 +++ b/include/linux/if_ppp.h
416 @@ -35,6 +35,8 @@
417
418 #include <linux/types.h>
419 #include <linux/compiler.h>
420 +#include <linux/if.h>
421 +#include <linux/ppp_defs.h>
422
423 /*
424 * Packet sizes
425 diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
426 index c58baea..249cd3e 100644
427 --- a/include/linux/if_pppol2tp.h
428 +++ b/include/linux/if_pppol2tp.h
429 @@ -16,10 +16,7 @@
430 #define __LINUX_IF_PPPOL2TP_H
431
432 #include <linux/types.h>
433 -
434 -#ifdef __KERNEL__
435 #include <linux/in.h>
436 -#endif
437
438 /* Structure used to connect() the socket to a particular tunnel UDP
439 * socket.
440 diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
441 index 16b92d0..55ce8a5 100644
442 --- a/include/linux/if_tunnel.h
443 +++ b/include/linux/if_tunnel.h
444 @@ -3,11 +3,9 @@
445
446 #include <linux/types.h>
447 #include <asm/byteorder.h>
448 -
449 -#ifdef __KERNEL__
450 +#include <linux/if.h>
451 #include <linux/ip.h>
452 #include <linux/in6.h>
453 -#endif
454
455 #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
456 #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
457 diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
458 index 1e7d8af..bee1e83 100644
459 --- a/include/linux/ipv6_route.h
460 +++ b/include/linux/ipv6_route.h
461 @@ -14,6 +14,7 @@
462 #define _LINUX_IPV6_ROUTE_H
463
464 #include <linux/types.h>
465 +#include <linux/in6.h>
466
467 #define RTF_DEFAULT 0x00010000 /* default - learned via ND */
468 #define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
469 diff --git a/include/linux/irda.h b/include/linux/irda.h
470 index 00bdad0..6ca2cf6 100644
471 --- a/include/linux/irda.h
472 +++ b/include/linux/irda.h
473 @@ -26,6 +26,7 @@
474 #define KERNEL_IRDA_H
475
476 #include <linux/types.h>
477 +#include <linux/socket.h>
478
479 /* Please do *not* add any #include in this file, this file is
480 * included as-is in user space.
481 diff --git a/include/linux/llc.h b/include/linux/llc.h
482 index ad7074b..59fbdf9 100644
483 --- a/include/linux/llc.h
484 +++ b/include/linux/llc.h
485 @@ -12,6 +12,10 @@
486 *
487 * See the GNU General Public License for more details.
488 */
489 +
490 +#include <linux/if.h>
491 +#include <linux/socket.h>
492 +
493 #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
494 struct sockaddr_llc {
495 sa_family_t sllc_family; /* AF_LLC */
496 diff --git a/include/linux/netrom.h b/include/linux/netrom.h
497 index 6939b32..af7313c 100644
498 --- a/include/linux/netrom.h
499 +++ b/include/linux/netrom.h
500 @@ -7,6 +7,8 @@
501 #ifndef NETROM_KERNEL_H
502 #define NETROM_KERNEL_H
503
504 +#include <linux/ax25.h>
505 +
506 #define NETROM_MTU 236
507
508 #define NETROM_T1 1
509 diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
510 index 812bc1e..10c5cd2 100644
511 --- a/include/linux/nfsd/syscall.h
512 +++ b/include/linux/nfsd/syscall.h
513 @@ -10,6 +10,7 @@
514 #define NFSD_SYSCALL_H
515
516 #include <linux/types.h>
517 +#include <linux/in.h>
518 #include <linux/nfsd/export.h>
519
520 /*
521 diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h
522 index c490fbc..2a0269a 100644
523 --- a/include/linux/romfs_fs.h
524 +++ b/include/linux/romfs_fs.h
525 @@ -1,6 +1,8 @@
526 #ifndef __LINUX_ROMFS_FS_H
527 #define __LINUX_ROMFS_FS_H
528
529 +#include <linux/types.h>
530 +
531 /* The basic structures of the romfs filesystem */
532
533 #define ROMBSIZE BLOCK_SIZE
534 diff --git a/include/linux/rose.h b/include/linux/rose.h
535 index c7b4b18..5bcbba1 100644
536 --- a/include/linux/rose.h
537 +++ b/include/linux/rose.h
538 @@ -7,6 +7,9 @@
539 #ifndef ROSE_KERNEL_H
540 #define ROSE_KERNEL_H
541
542 +#include <linux/socket.h>
543 +#include <linux/ax25.h>
544 +
545 #define ROSE_MTU 251
546
547 #define ROSE_MAX_DIGIS 6
548 diff --git a/include/linux/scc.h b/include/linux/scc.h
549 index 3495bd9..d5916e5 100644
550 --- a/include/linux/scc.h
551 +++ b/include/linux/scc.h
552 @@ -3,6 +3,7 @@
553 #ifndef _SCC_H
554 #define _SCC_H
555
556 +#include <linux/sockios.h>
557
558 /* selection of hardware types */
559
560 diff --git a/include/linux/times.h b/include/linux/times.h
561 index 87b6261..a449fd0 100644
562 --- a/include/linux/times.h
563 +++ b/include/linux/times.h
564 @@ -2,6 +2,7 @@
565 #define _LINUX_TIMES_H
566
567 #include <linux/types.h>
568 +#include <linux/time.h>
569
570 struct tms {
571 __kernel_clock_t tms_utime;
572 diff --git a/include/linux/un.h b/include/linux/un.h
573 index 45561c5..77371f5 100644
574 --- a/include/linux/un.h
575 +++ b/include/linux/un.h
576 @@ -1,6 +1,8 @@
577 #ifndef _LINUX_UN_H
578 #define _LINUX_UN_H
579
580 +#include <linux/socket.h>
581 +
582 #define UNIX_PATH_MAX 108
583
584 struct sockaddr_un {
585 diff --git a/include/linux/x25.h b/include/linux/x25.h
586 index 6450a7f..eaceb8c 100644
587 --- a/include/linux/x25.h
588 +++ b/include/linux/x25.h
589 @@ -12,6 +12,7 @@
590 #define X25_KERNEL_H
591
592 #include <linux/types.h>
593 +#include <linux/socket.h>
594
595 #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
596 #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
597 --
598 1.7.1
599
600
601
602
603 1.1 src/patchsets/gentoo-headers/2.6.34/0006-HACK-asm-pull-in-C-library-headers.patch
604
605 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0006-HACK-asm-pull-in-C-library-headers.patch?rev=1.1&view=markup
606 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0006-HACK-asm-pull-in-C-library-headers.patch?rev=1.1&content-type=text/plain
607
608 Index: 0006-HACK-asm-pull-in-C-library-headers.patch
609 ===================================================================
610 From c2b8791c232bf074565e6f462725120686f4da48 Mon Sep 17 00:00:00 2001
611 From: Mike Frysinger <vapier@g.o>
612 Date: Mon, 29 Dec 2008 07:39:14 -0500
613 Subject: [PATCH 6/9] HACK: asm/*: pull in C library headers
614
615 Pull in the libc versions of these headers so that the proper
616 userspace defines/typedefs are utilized.
617
618 Signed-off-by: Mike Frysinger <vapier@g.o>
619 ---
620 include/asm-generic/fcntl.h | 5 +++++
621 include/asm-generic/siginfo.h | 5 ++++-
622 2 files changed, 9 insertions(+), 1 deletions(-)
623
624 diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
625 index fcd268c..aa54f91 100644
626 --- a/include/asm-generic/fcntl.h
627 +++ b/include/asm-generic/fcntl.h
628 @@ -1,6 +1,11 @@
629 #ifndef _ASM_GENERIC_FCNTL_H
630 #define _ASM_GENERIC_FCNTL_H
631
632 +/* Pull in fcntl structs from the libc #244470 */
633 +#include <fcntl.h>
634 +#define HAVE_ARCH_STRUCT_FLOCK
635 +#define HAVE_ARCH_STRUCT_FLOCK64
636 +
637 #include <linux/types.h>
638
639 #define O_ACCMODE 00000003
640 diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
641 index 942d30b..cd9ed99 100644
642 --- a/include/asm-generic/siginfo.h
643 +++ b/include/asm-generic/siginfo.h
644 @@ -1,6 +1,10 @@
645 #ifndef _ASM_GENERIC_SIGINFO_H
646 #define _ASM_GENERIC_SIGINFO_H
647
648 +#ifndef __KERNEL__
649 +# include <signal.h>
650 +#else
651 +
652 #include <linux/compiler.h>
653 #include <linux/types.h>
654
655 @@ -275,7 +279,6 @@ typedef struct sigevent {
656 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
657 #define sigev_notify_thread_id _sigev_un._tid
658
659 -#ifdef __KERNEL__
660
661 struct siginfo;
662 void do_schedule_next_timer(struct siginfo *info);
663 --
664 1.7.1
665
666
667
668
669 1.1 src/patchsets/gentoo-headers/2.6.34/0007-HACK-linux-pull-in-C-library-headers.patch
670
671 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0007-HACK-linux-pull-in-C-library-headers.patch?rev=1.1&view=markup
672 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0007-HACK-linux-pull-in-C-library-headers.patch?rev=1.1&content-type=text/plain
673
674 Index: 0007-HACK-linux-pull-in-C-library-headers.patch
675 ===================================================================
676 From 68126aac2782711db56a147b00d75fc5bf13d1f5 Mon Sep 17 00:00:00 2001
677 From: Mike Frysinger <vapier@g.o>
678 Date: Mon, 29 Dec 2008 07:40:08 -0500
679 Subject: [PATCH 7/9] HACK: linux/*: pull in C library headers
680
681 pull in the libc versions of these headers so that the proper userspace
682 defines/typedefs are utilized.
683
684 the trouble here is that some of the linux/ headers define structs that the
685 libc net/ headers define (like the if.h header). we cannot simply say
686 "your program should not include linux/if.h when using net/if.h" because some
687 of the other linux/ headers may correctly be utilized with net/if.h but they
688 correctly include linux/if.h. we also cannot say "just use the linux/ headers
689 and not the libc net/ headers" because the libc headers include more
690 definitions than its kernel equivalent.
691
692 since there is no obvious (at least to me) answer here, we hack the linux/
693 headers to simply pull in userspace headers and ignore the linux/ ones
694 completely. this seems to give a proper clean userspace experience.
695
696 Signed-off-by: Mike Frysinger <vapier@g.o>
697 ---
698 include/linux/cdrom.h | 3 ++
699 include/linux/if.h | 8 +++--
700 include/linux/in.h | 66 ++++++++++++++++++++++++++++++++++++++++-------
701 include/linux/in6.h | 11 +++----
702 include/linux/ip.h | 3 +-
703 include/linux/socket.h | 5 +++
704 include/linux/stat.h | 4 +++
705 include/linux/time.h | 11 +++++---
706 include/linux/types.h | 1 +
707 9 files changed, 88 insertions(+), 24 deletions(-)
708
709 diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
710 index 78e9047..e1b6ba8 100644
711 --- a/include/linux/cdrom.h
712 +++ b/include/linux/cdrom.h
713 @@ -12,6 +12,9 @@
714 #define _LINUX_CDROM_H
715
716 #include <linux/types.h>
717 +#ifndef __KERNEL__
718 +# include <limits.h>
719 +#endif
720 #include <asm/byteorder.h>
721
722 /*******************************************************
723 diff --git a/include/linux/if.h b/include/linux/if.h
724 index 3a9f410..12a59db 100644
725 --- a/include/linux/if.h
726 +++ b/include/linux/if.h
727 @@ -19,6 +19,8 @@
728 #ifndef _LINUX_IF_H
729 #define _LINUX_IF_H
730
731 +#include <net/if.h>
732 +
733 #include <linux/types.h> /* for "__kernel_caddr_t" et al */
734 #include <linux/socket.h> /* for "struct sockaddr" et al */
735 #include <linux/compiler.h> /* for "__user" et al */
736 @@ -126,7 +128,7 @@ enum {
737 * being very small might be worth keeping for clean configuration.
738 */
739
740 -struct ifmap {
741 +struct __kernel_ifmap {
742 unsigned long mem_start;
743 unsigned long mem_end;
744 unsigned short base_addr;
745 @@ -160,7 +162,7 @@ struct if_settings {
746 * remainder may be interface specific.
747 */
748
749 -struct ifreq {
750 +struct __kernel_ifreq {
751 #define IFHWADDRLEN 6
752 union
753 {
754 @@ -209,7 +211,7 @@ struct ifreq {
755 * must know all networks accessible).
756 */
757
758 -struct ifconf {
759 +struct __kernel_ifconf {
760 int ifc_len; /* size of buffer */
761 union {
762 char __user *ifcu_buf;
763 diff --git a/include/linux/in.h b/include/linux/in.h
764 index 583c76f..af6f025 100644
765 --- a/include/linux/in.h
766 +++ b/include/linux/in.h
767 @@ -18,42 +18,88 @@
768 #ifndef _LINUX_IN_H
769 #define _LINUX_IN_H
770
771 +#include <netinet/in.h>
772 +
773 #include <linux/types.h>
774 #include <linux/socket.h>
775
776 /* Standard well-defined IP protocols. */
777 enum {
778 +#ifndef IPPROTO_IP
779 IPPROTO_IP = 0, /* Dummy protocol for TCP */
780 +#endif
781 +#ifndef IPPROTO_ICMP
782 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
783 +#endif
784 +#ifndef IPPROTO_IGMP
785 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
786 +#endif
787 +#ifndef IPPROTO_IPIP
788 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
789 +#endif
790 +#ifndef IPPROTO_TCP
791 IPPROTO_TCP = 6, /* Transmission Control Protocol */
792 +#endif
793 +#ifndef IPPROTO_EGP
794 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
795 +#endif
796 +#ifndef IPPROTO_PUP
797 IPPROTO_PUP = 12, /* PUP protocol */
798 +#endif
799 +#ifndef IPPROTO_UDP
800 IPPROTO_UDP = 17, /* User Datagram Protocol */
801 +#endif
802 +#ifndef IPPROTO_IDP
803 IPPROTO_IDP = 22, /* XNS IDP protocol */
804 +#endif
805 +#ifndef IPPROTO_DCCP
806 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
807 +#endif
808 +#ifndef IPPROTO_RSVP
809 IPPROTO_RSVP = 46, /* RSVP protocol */
810 +#endif
811 +#ifndef IPPROTO_GRE
812 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
813 +#endif
814
815 +#ifndef IPPROTO_IPV6
816 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
817 +#endif
818
819 +#ifndef IPPROTO_ESP
820 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
821 +#endif
822 +#ifndef IPPROTO_AH
823 IPPROTO_AH = 51, /* Authentication Header protocol */
824 +#endif
825 +#ifndef IPPROTO_BEETPH
826 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
827 +#endif
828 +#ifndef IPPROTO_PIM
829 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
830 +#endif
831
832 +#ifndef IPPROTO_COMP
833 IPPROTO_COMP = 108, /* Compression Header protocol */
834 +#endif
835 +#ifndef IPPROTO_SCTP
836 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
837 +#endif
838 +#ifndef IPPROTO_UDPLITE
839 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
840 +#endif
841
842 +#ifndef IPPROTO_RAW
843 IPPROTO_RAW = 255, /* Raw IP packets */
844 +#endif
845 +#if 0
846 IPPROTO_MAX
847 +#endif
848 };
849
850
851 /* Internet address. */
852 -struct in_addr {
853 +struct __kernel_in_addr {
854 __be32 s_addr;
855 };
856
857 @@ -120,24 +166,24 @@ struct in_addr {
858
859 /* Request struct for multicast socket ops */
860
861 -struct ip_mreq {
862 +struct __kernel_ip_mreq {
863 struct in_addr imr_multiaddr; /* IP multicast address of group */
864 struct in_addr imr_interface; /* local IP address of interface */
865 };
866
867 -struct ip_mreqn {
868 +struct __kernel_ip_mreqn {
869 struct in_addr imr_multiaddr; /* IP multicast address of group */
870 struct in_addr imr_address; /* local IP address of interface */
871 int imr_ifindex; /* Interface index */
872 };
873
874 -struct ip_mreq_source {
875 +struct __kernel_ip_mreq_source {
876 __be32 imr_multiaddr;
877 __be32 imr_interface;
878 __be32 imr_sourceaddr;
879 };
880
881 -struct ip_msfilter {
882 +struct __kernel_ip_msfilter {
883 __be32 imsf_multiaddr;
884 __be32 imsf_interface;
885 __u32 imsf_fmode;
886 @@ -149,18 +195,18 @@ struct ip_msfilter {
887 (sizeof(struct ip_msfilter) - sizeof(__u32) \
888 + (numsrc) * sizeof(__u32))
889
890 -struct group_req {
891 +struct __kernel_group_req {
892 __u32 gr_interface; /* interface index */
893 struct __kernel_sockaddr_storage gr_group; /* group address */
894 };
895
896 -struct group_source_req {
897 +struct __kernel_group_source_req {
898 __u32 gsr_interface; /* interface index */
899 struct __kernel_sockaddr_storage gsr_group; /* group address */
900 struct __kernel_sockaddr_storage gsr_source; /* source address */
901 };
902
903 -struct group_filter {
904 +struct __kernel_group_filter {
905 __u32 gf_interface; /* interface index */
906 struct __kernel_sockaddr_storage gf_group; /* multicast address */
907 __u32 gf_fmode; /* filter mode */
908 @@ -172,7 +218,7 @@ struct group_filter {
909 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
910 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
911
912 -struct in_pktinfo {
913 +struct __kernel_in_pktinfo {
914 int ipi_ifindex;
915 struct in_addr ipi_spec_dst;
916 struct in_addr ipi_addr;
917 @@ -180,7 +226,7 @@ struct in_pktinfo {
918
919 /* Structure describing an Internet (IP) socket address. */
920 #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
921 -struct sockaddr_in {
922 +struct __kernel_sockaddr_in {
923 sa_family_t sin_family; /* Address family */
924 __be16 sin_port; /* Port number */
925 struct in_addr sin_addr; /* Internet address */
926 diff --git a/include/linux/in6.h b/include/linux/in6.h
927 index bd55c6e..3f53b0f 100644
928 --- a/include/linux/in6.h
929 +++ b/include/linux/in6.h
930 @@ -21,21 +21,20 @@
931 #ifndef _LINUX_IN6_H
932 #define _LINUX_IN6_H
933
934 +#include <netinet/in.h>
935 +
936 #include <linux/types.h>
937
938 /*
939 * IPv6 address structure
940 */
941
942 -struct in6_addr {
943 +struct __kernel_in6_addr {
944 union {
945 __u8 u6_addr8[16];
946 __be16 u6_addr16[8];
947 __be32 u6_addr32[4];
948 } in6_u;
949 -#define s6_addr in6_u.u6_addr8
950 -#define s6_addr16 in6_u.u6_addr16
951 -#define s6_addr32 in6_u.u6_addr32
952 };
953
954 /* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
955 @@ -55,7 +54,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
956 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
957 #endif
958
959 -struct sockaddr_in6 {
960 +struct __kernel_sockaddr_in6 {
961 unsigned short int sin6_family; /* AF_INET6 */
962 __be16 sin6_port; /* Transport layer port # */
963 __be32 sin6_flowinfo; /* IPv6 flow information */
964 @@ -63,7 +62,7 @@ struct sockaddr_in6 {
965 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
966 };
967
968 -struct ipv6_mreq {
969 +struct __kernel_ipv6_mreq {
970 /* IPv6 multicast address of group */
971 struct in6_addr ipv6mr_multiaddr;
972
973 diff --git a/include/linux/ip.h b/include/linux/ip.h
974 index bd0a2a8..19619cc 100644
975 --- a/include/linux/ip.h
976 +++ b/include/linux/ip.h
977 @@ -16,6 +16,7 @@
978 */
979 #ifndef _LINUX_IP_H
980 #define _LINUX_IP_H
981 +#include <netinet/ip.h>
982 #include <linux/types.h>
983 #include <asm/byteorder.h>
984
985 @@ -82,7 +83,7 @@
986
987 #define IPV4_BEET_PHMAXLEN 8
988
989 -struct iphdr {
990 +struct __kernel_iphdr {
991 #if defined(__LITTLE_ENDIAN_BITFIELD)
992 __u8 ihl:4,
993 version:4;
994 diff --git a/include/linux/socket.h b/include/linux/socket.h
995 index 354cc56..46edcd8 100644
996 --- a/include/linux/socket.h
997 +++ b/include/linux/socket.h
998 @@ -328,4 +328,9 @@ extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen
999 unsigned int flags, struct timespec *timeout);
1000 #endif
1001 #endif /* not kernel and not glibc */
1002 +
1003 +#ifndef __KERNEL__
1004 +# include <sys/socket.h>
1005 +#endif
1006 +
1007 #endif /* _LINUX_SOCKET_H */
1008 diff --git a/include/linux/stat.h b/include/linux/stat.h
1009 index 5460344..a90fdb2 100644
1010 --- a/include/linux/stat.h
1011 +++ b/include/linux/stat.h
1012 @@ -77,4 +77,8 @@ struct kstat {
1013
1014 #endif
1015
1016 +#ifndef __KERNEL__
1017 +# include <sys/stat.h>
1018 +#endif
1019 +
1020 #endif
1021 diff --git a/include/linux/time.h b/include/linux/time.h
1022 index 6e026e4..ab8573e 100644
1023 --- a/include/linux/time.h
1024 +++ b/include/linux/time.h
1025 @@ -1,13 +1,15 @@
1026 #ifndef _LINUX_TIME_H
1027 #define _LINUX_TIME_H
1028
1029 +#include <time.h>
1030 +#include <sys/time.h>
1031 +
1032 #include <linux/types.h>
1033
1034 #ifdef __KERNEL__
1035 # include <linux/cache.h>
1036 # include <linux/seqlock.h>
1037 # include <linux/math64.h>
1038 -#endif
1039
1040 #ifndef _STRUCT_TIMESPEC
1041 #define _STRUCT_TIMESPEC
1042 @@ -27,8 +29,6 @@ struct timezone {
1043 int tz_dsttime; /* type of dst correction */
1044 };
1045
1046 -#ifdef __KERNEL__
1047 -
1048 extern struct timezone sys_tz;
1049
1050 /* Parameters used to convert the timespec values: */
1051 @@ -238,7 +238,6 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
1052 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
1053 a->tv_nsec = ns;
1054 }
1055 -#endif /* __KERNEL__ */
1056
1057 #define NFDBITS __NFDBITS
1058
1059 @@ -266,6 +265,8 @@ struct itimerval {
1060 struct timeval it_value; /* current value */
1061 };
1062
1063 +#endif /* __KERNEL__ */
1064 +
1065 /*
1066 * The IDs of the various system clocks (for POSIX.1b interval timers):
1067 */
1068 @@ -288,6 +289,8 @@ struct itimerval {
1069 /*
1070 * The various flags for setting POSIX.1b interval timers:
1071 */
1072 +#ifndef TIMER_ABSTIME
1073 #define TIMER_ABSTIME 0x01
1074 +#endif
1075
1076 #endif
1077 diff --git a/include/linux/types.h b/include/linux/types.h
1078 index 7a13ab4..4b7caf6 100644
1079 --- a/include/linux/types.h
1080 +++ b/include/linux/types.h
1081 @@ -11,6 +11,7 @@
1082
1083 #endif
1084
1085 +#include <sys/types.h>
1086 #include <linux/posix_types.h>
1087
1088 #ifdef __KERNEL__
1089 --
1090 1.7.1
1091
1092
1093
1094
1095 1.1 src/patchsets/gentoo-headers/2.6.34/0008-netfilter-pull-in-limits.h.patch
1096
1097 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0008-netfilter-pull-in-limits.h.patch?rev=1.1&view=markup
1098 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0008-netfilter-pull-in-limits.h.patch?rev=1.1&content-type=text/plain
1099
1100 Index: 0008-netfilter-pull-in-limits.h.patch
1101 ===================================================================
1102 From 210d20ae112addb166ff99d706e64fc90fb1091e Mon Sep 17 00:00:00 2001
1103 From: Mike Frysinger <vapier@g.o>
1104 Date: Sat, 9 May 2009 17:30:35 -0400
1105 Subject: [PATCH 8/9] netfilter: pull in limits.h
1106
1107 A few netfilter sub-headers use INT_MAX which is in limits.h.
1108
1109 URL: http://bugs.gentoo.org/246160
1110 Signed-off-by: Mike Frysinger <vapier@g.o>
1111 ---
1112 include/linux/netfilter.h | 1 +
1113 1 files changed, 1 insertions(+), 0 deletions(-)
1114
1115 diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
1116 index 89341c3..3617225 100644
1117 --- a/include/linux/netfilter.h
1118 +++ b/include/linux/netfilter.h
1119 @@ -13,6 +13,7 @@
1120 #endif
1121 #include <linux/types.h>
1122 #include <linux/compiler.h>
1123 +#include <limits.h>
1124
1125 /* Responses from hook functions. */
1126 #define NF_DROP 0
1127 --
1128 1.7.1
1129
1130
1131
1132
1133 1.1 src/patchsets/gentoo-headers/2.6.34/0009-convert-PAGE_SIZE-usage.patch
1134
1135 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0009-convert-PAGE_SIZE-usage.patch?rev=1.1&view=markup
1136 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gentoo-headers/2.6.34/0009-convert-PAGE_SIZE-usage.patch?rev=1.1&content-type=text/plain
1137
1138 Index: 0009-convert-PAGE_SIZE-usage.patch
1139 ===================================================================
1140 From 449b075ff73f28c3622080071589dd2f660b52ea Mon Sep 17 00:00:00 2001
1141 From: Mike Frysinger <vapier@g.o>
1142 Date: Sat, 13 Feb 2010 03:09:23 -0500
1143 Subject: [PATCH 9/9] convert PAGE_SIZE usage
1144
1145 The size of a page may change at runtime or based on kernel settings, so
1146 a static value at compile time doesn't work. More importantly, no one
1147 exports PAGE_SIZE to user space anymore.
1148
1149 URL: http://bugs.gentoo.org/301431
1150 Signed-off-by: Mike Frysinger <vapier@g.o>
1151 ---
1152 include/linux/binfmts.h | 3 ++-
1153 include/linux/resource.h | 3 ++-
1154 2 files changed, 4 insertions(+), 2 deletions(-)
1155
1156 diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
1157 index c809e28..18be62b 100644
1158 --- a/include/linux/binfmts.h
1159 +++ b/include/linux/binfmts.h
1160 @@ -1,6 +1,7 @@
1161 #ifndef _LINUX_BINFMTS_H
1162 #define _LINUX_BINFMTS_H
1163
1164 +#include <unistd.h>
1165 #include <linux/capability.h>
1166
1167 struct pt_regs;
1168 @@ -11,7 +12,7 @@ struct pt_regs;
1169 * prevent the kernel from being unduly impacted by misaddressed pointers.
1170 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
1171 */
1172 -#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
1173 +#define MAX_ARG_STRLEN (sysconf(_SC_PAGESIZE) * 32)
1174 #define MAX_ARG_STRINGS 0x7FFFFFFF
1175
1176 /* sizeof(linux_binprm->buf) */
1177 diff --git a/include/linux/resource.h b/include/linux/resource.h
1178 index f1e914e..4e0beaf 100644
1179 --- a/include/linux/resource.h
1180 +++ b/include/linux/resource.h
1181 @@ -60,7 +60,8 @@ struct rlimit {
1182 * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
1183 * and other sensitive information are never written to disk.
1184 */
1185 -#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
1186 +/* No one currently defines PAGE_SIZE bigger than 64kB */
1187 +#define MLOCK_LIMIT (64 * 1024)
1188
1189 /*
1190 * Due to binary compatibility, the actual resource numbers
1191 --
1192 1.7.1