19 void RUNEENTRYABI rune_entry_main(args_t *args, rval_t *rval);
21 static void startRuneProgram(void *data);
24 main(int ac, char **av)
32 * Rune binary execution
34 RuneMode = RUNEMODE_BINARY;
37 * We want a core dump for any dpanic during the execution of a Rune
44 * Make sure that descriptors 0, 1, and 2 exist.
47 fd = open("/dev/null", O_RDWR);
48 } while (fd >= 0 && fd < 2);
53 * General initialization - the runtime only uses libsupport.
66 threadEnvironmentStart(1);
67 startRuneProgram(ary);
69 /* exit (even if there are threads present) */
74 /* __attribute((__section__("runectors"))) void *X; */
77 * CTORS are added in their own section and must be executed in forward
80 extern void **start_runectors;
81 extern void **stop_runectors;
82 typedef void RUNEENTRYABI(*ctorfunc_t) (void *dummy);
86 startRuneProgram(void *data)
90 for (ary = start_runectors; ary < stop_runectors; ++ary) {
91 ((ctorfunc_t) *ary) (NULL);
95 rune_entry_main(ary[0], ary[1]);
96 /* rune_entry_main(&args, &rval); */
99 fprintf(stderr, "MAIN EXITED, waiting for threads\n");
100 threadWaitTerminate();