Browse Source

nptl: Use vfork on MMU-less for system()

	* libc/stdlib/system.c (FORK): Map to vfork if __ARCH_USE_MMU__
	is defined.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Christophe Lyon 5 years ago
parent
commit
606a8b28e4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      libc/stdlib/system.c

+ 5 - 0
libc/stdlib/system.c

@@ -81,6 +81,7 @@ out:
 libc_hidden_proto(sigaction)
 libc_hidden_proto(waitpid)
 
+#ifdef __ARCH_USE_MMU__
 #if defined __ia64__
 # define FORK() \
   INLINE_SYSCALL (clone2, 6, CLONE_PARENT_SETTID | SIGCHLD, NULL, 0, \
@@ -92,6 +93,10 @@ libc_hidden_proto(waitpid)
 # define FORK() \
   INLINE_SYSCALL (clone, 3, CLONE_PARENT_SETTID | SIGCHLD, 0, &pid)
 #endif
+#else
+# define FORK() \
+    vfork()
+#endif
 
 static void cancel_handler (void *arg);