Hi

Michael Stepanov wrote:
> when the SDL program crashed by some reason to run it again. What is the
> most efficient way to periodically check something in the Maemo SDK?

I think in your case it would be sufficient to do something like this:
while true; do
  ./run-your-application params
  sleep 2
done

Or in C:

while(1) {
  system("./run-your-application params");
  sleep(2);
}

Linux (kernel) does not have a non-polling mechanism to track
PID-existance for non-related processes (adding this is not that hard,
one hooks into the same logic that is used for BSD style process
accounting, but this isn't present in stock kernel).

Obviously you'll want to also check the reason why your application
"crashed" and act on that (branching on the exit code) but that was
omitted from the above snippets.

ak.
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to