[uClibc]Problems with system()/vfork() on PowerPC
Simon Rowe
srowe at cambridgebroadband.com
Tue Mar 4 11:21:17 UTC 2003
A colleague of mine is having problems with an application that uses
system(). Running the following test application fails on PPC but works on
Intel.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int ret = system("echo hello");
printf("return val is %d\n", ret);
while (1) {
printf(".");
fflush(stdout);
sleep(1);
}
return 0;
}
For the run below I've added an extra printf() after the execl() call, the
"Waiting for child" diagnostic which I re-enabled doesn't appear. The
_exit(127) also seems to be affecting the parent process and not the child.
/home2/srowe/public # ./system
hello
execl returned 3056
/home2/srowe/public # echo $?
127
If I force the use of fork() rather than vfork() then the program behaves as
expected.
/home2/srowe/public # ./system
hello
Waiting for child 2638
return val is 0
..........
This is a problem with 0.9.18 and 0.9.19, is the PPC vfork() broken?
--
Simon Rowe
Cambridge Broadband Ltd
More information about the uClibc
mailing list