patches/glibc/ports-2.12.1/190-localedef-mmap.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu May 26 22:51:03 2011 +0200 (2011-05-26)
changeset 2481 30644208c955
permissions -rw-r--r--
configure: add possibility to set arbitrary variable in check_for

If check_for is able to find the required prog/inc/lib, allow it to
set an arbitrary variable to 'y'. This variable is then pushed down
to the kconfig definition.

For example:
has_or_abort prog=foobar kconfig=has_foobar

If foobar is available, it yields a kconfig variable defaulting to y:
config CONFIGURE_has_foobar
bool
default y

If foobar is missing, it yields a kconfig variable defaulting to n:
config CONFIGURE_has_foobar
bool

Thus it is possible to depends on that variabel to show/hide options:
config SOME_FEATURE
bool
prompt "Some feature"
depends on CONFIGURE_has_foobar

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@2437
     1
sniped from Debian
yann@2437
     2
http://bugs.gentoo.org/289615
yann@2437
     3
yann@2437
     4
2009-10-27  Aurelien Jarno  <aurelien@aurel32.net>
yann@2437
     5
yann@2437
     6
	* locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
yann@2437
     7
	used later with MMAP_FIXED | MMAP_SHARED to cope with different
yann@2437
     8
	alignment restrictions.
yann@2437
     9
yann@2437
    10
diff -durN glibc-2.12.1.orig/locale/programs/locarchive.c glibc-2.12.1/locale/programs/locarchive.c
yann@2437
    11
--- glibc-2.12.1.orig/locale/programs/locarchive.c	2009-04-27 16:07:47.000000000 +0200
yann@2437
    12
+++ glibc-2.12.1/locale/programs/locarchive.c	2009-11-13 00:50:01.000000000 +0100
yann@2437
    13
@@ -134,7 +134,7 @@
yann@2437
    14
   size_t reserved = RESERVE_MMAP_SIZE;
yann@2437
    15
   int xflags = 0;
yann@2437
    16
   if (total < reserved
yann@2437
    17
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    18
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    19
 		       -1, 0)) != MAP_FAILED))
yann@2437
    20
     xflags = MAP_FIXED;
yann@2437
    21
   else
yann@2437
    22
@@ -396,7 +396,7 @@
yann@2437
    23
   size_t reserved = RESERVE_MMAP_SIZE;
yann@2437
    24
   int xflags = 0;
yann@2437
    25
   if (total < reserved
yann@2437
    26
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    27
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    28
 		       -1, 0)) != MAP_FAILED))
yann@2437
    29
     xflags = MAP_FIXED;
yann@2437
    30
   else
yann@2437
    31
@@ -614,7 +614,7 @@
yann@2437
    32
   int xflags = 0;
yann@2437
    33
   void *p;
yann@2437
    34
   if (st.st_size < reserved
yann@2437
    35
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    36
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    37
 		       -1, 0)) != MAP_FAILED))
yann@2437
    38
     xflags = MAP_FIXED;
yann@2437
    39
   else