One more thing though, why do you call exit "an un-amiga call"?
exit() terminates execution of the application, only calling routines added by atexit(), (and executing destructors, if any).
This indeed works ok for standard C applications that use ANSI C filehandles (fopen), memory (malloc) and such only, these are released properly at exit() call.
However, AmigaOS resources are NOT released at all, unless if you expicitly add cleanup routine with atexit().
As such, using exit() in Amiga application is not a good design IMO.
Take this (buggy) example:
#include <dos/dos.h>
#include <proto/exec.h>
#include <proto/dos.h>
int main(void)
{
BPTR fh;
fh = Open("t:testfile", MODE_NEWFILE);
if (fh)
{
struct Library *SomeBase;
SomeBase = OpenLibrary("some.library", 0);
if (!SomeBase)
{
/* BUG: note that fh is not closed */
exit(20);
}
CloseLibrary(SomeBase);
Close(fh);
}
return 0;
}