[uClibc-cvs] uClibc/libc/unistd exec.c,1.2,1.3

Manuel Novoa III mjn3 at uclibc.org
Tue Feb 17 10:40:49 UTC 2004


Update of /var/cvs/uClibc/libc/unistd
In directory nail:/tmp/cvs-serv25250

Modified Files:
	exec.c 
Log Message:
Sigh... Fall back to alloca() if munmap is broken (uClinux).


Index: exec.c
===================================================================
RCS file: /var/cvs/uClibc/libc/unistd/exec.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- exec.c	16 Jan 2004 13:43:23 -0000	1.2
+++ exec.c	17 Feb 2004 10:40:47 -0000	1.3
@@ -17,6 +17,8 @@
 
 /* Jan 1, 2004
  *   Initial version of a SUSv3 compliant exec*() functions.
+ * Feb 17, 2004
+ *   Sigh... Fall back to alloca() if munmap() is broken on uClinux.
  */
 
 /* NOTE: Strictly speaking, there could be problems from accessing
@@ -41,10 +43,10 @@
 extern char *__strchrnul(const char *s, int c);
 
 /**********************************************************************/
-#ifdef __ARCH_HAS_MMU__
+#if defined(__ARCH_HAS_MMU__) || defined(__UCLIBC_UCLINUX_BROKEN_MUNMAP__)
 
 /* We have an MMU, so use alloca() to grab space for buffers and
- * arg lists. */
+ * arg lists.  Also fall back to alloca() if munmap() is broken. */
 
 # define EXEC_ALLOC_SIZE(VAR)	/* nothing to do */
 # define EXEC_ALLOC(SIZE,VAR)	alloca((SIZE))
@@ -65,11 +67,7 @@
 extern void *__exec_alloc(size_t size);
 extern void __exec_free(void *ptr, size_t size);
 
-#endif
-/**********************************************************************/
-#ifdef L___exec_alloc
-
-#ifndef __ARCH_HAS_MMU__
+# ifdef L___exec_alloc
 
 void *__exec_alloc(size_t size)
 {
@@ -87,7 +85,7 @@
 	}
 }
 
-#endif
+# endif
 
 #endif
 /**********************************************************************/




More information about the uClibc-cvs mailing list