On Wednesday, February 12, 2003, at 10:12 AM, email@hidden
The 'ten' program is the main() that is also listed in my program
listing, between the /* */ above the other. I've included everything
Oops. It's early. ;-)
'./ten' at itsself runs perfectly at the command line. The 'done'
message does not appear, so 'ten' should be running fine. Well, it
does pop-up in the Process Viewer, so it runs yes, but only a fraction
of a second, but it should wait for ten seconds (see listing below)
and then exit. Indeed, I do not want to see the 'done' message, it was
only put there as a test.
execvp("./ten",0); // this is the code the child runs
The problem is with the execvp(). You aren't providing an argument
list terminated with a NULL element, you are providing an entirely NULL
argument list. That's not kosher, and the ./ten application itself is
crashing just before main() as a result. You want something like:
PS: Given an absolute path like "./ten", you really don't need to go
the expense of doing a path-based exec() like execvp() provides. Just
use execv(). It's more efficient.
unix-porting mailing list | email@hidden
Do not post admin requests to the list. They will be ignored.