8 main (int argc
, char **argv
)
10 fprintf(stderr
, "starting ...\n");
12 // Three ways of going away...
15 // Explicit exit() with exit code.
16 if (strcmp (argv
[1], "exit") == 0)
18 fprintf(stderr
, "exiting ...\n");
22 // Get killed by a signal.
23 if (strcmp (argv
[1], "abort") == 0)
25 fprintf(stderr
, "aborting ...\n");
26 kill(getpid(), SIGABRT
);
30 // And finally, just return from main with success.
31 fprintf(stderr
, "returning ...\n");