jeudi 7 juillet 2016

Linux WaitForSingleObject?


Here a piece of code showing the problem //main Process* process = NULL; while(!process) { cout<<endl<<"Waiting for second process.nPress any key"; getchar(); getchar(); process = Process::takeExisting("process"); } Process::waitEnd(process); //Problem here cout<<endl<<"second process ended"; //Process::waitEnd static void waitEnd(Process* proc) { int w = waitpid(proc->hProcess, &(proc->exitCode), WCONTINUED); Debug::error(errno," waitpid error - "); } I've tried: stop first, wait second ends, continue first. The problem: the second process is not child( I run it from second console ) so with this code errno is equal to 10. How to solve this on Linux?

Aucun commentaire:

Enregistrer un commentaire