ce04fea445
call them. All the execX() libc functions should be vfork() safe now. Specifically: - execlp() does the argument count-and-build into a vector from alloca (like the others) - buildargv() is no longer used (and gone). - execvp() uses alloca/strcpy rather than strdup(). - the ENOEXEC handler uses alloca rather than malloc. - a couple of free() calls removed - alloca works on the local stack and the allocations are freed on function exit (which is why buildargv wasn't useful - it's alloca() context would disappear on return). Along the way: - If alloca() fails (can it?), set errno = ENOMEM explicitly. - The ENOEXEC recovery routine that trys again with /bin/sh appeared to not be terminating the new argv[] array for /bin/sh, allowing it to walk off the end of the list. I dithered a bit about using alloca() even more as it's most commonly associated with gcc. However, standalone portable (using malloc) and machine-specific assembler alloca implementations appear to be available on just about all the architectures we're likely to want to port to. alloca will be the least of our problems if ever going to another compiler. |
||
---|---|---|
.. | ||
alpha | ||
amd64 | ||
compat-43 | ||
db | ||
gen | ||
gmon | ||
i386 | ||
include | ||
locale | ||
mips | ||
mipseb | ||
mipsel | ||
net | ||
nls | ||
quad | ||
regex | ||
rpc | ||
stdio | ||
stdlib | ||
stdtime | ||
string | ||
sys | ||
xdr | ||
yp | ||
Makefile | ||
Makefile.inc |