Bug 966154 - Don't use __fork, it's gone in newer bionic. r=glandium, a=sledru
authorJames Willcox <snorp@snorp.net>
Mon, 28 Apr 2014 10:21:22 -0500
changeset 192180 ae9db69edde3
parent 192179 5c955e3d64b6
child 192181 bd20a12260ea
push id3512
push userryanvm@gmail.com
push date2014-04-30 13:07 +0000
treeherdermozilla-beta@ae9db69edde3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, sledru
bugs966154
milestone30.0
Bug 966154 - Don't use __fork, it's gone in newer bionic. r=glandium, a=sledru
mozglue/build/BionicGlue.cpp
--- a/mozglue/build/BionicGlue.cpp
+++ b/mozglue/build/BionicGlue.cpp
@@ -92,28 +92,26 @@ WRAP(pthread_atfork)(void (*prepare)(voi
   funcs.parent = parent;
   funcs.child = child;
   if (!atfork.capacity())
     atfork.reserve(1);
   atfork.push_back(funcs);
   return 0;
 }
 
-extern "C" pid_t __fork(void);
-
 extern "C" NS_EXPORT pid_t
 WRAP(fork)(void)
 {
   pid_t pid;
   for (auto it = atfork.rbegin();
        it < atfork.rend(); ++it)
     if (it->prepare)
       it->prepare();
 
-  switch ((pid = __fork())) {
+  switch ((pid = syscall(__NR_clone, SIGCHLD, NULL, NULL, NULL, NULL))) {
   case 0:
     cpuacct_add(getuid());
     for (auto it = atfork.begin();
          it < atfork.end(); ++it)
       if (it->child)
         it->child();
     break;
   default: