| typedef struct Mainarg Mainarg; |
| extern void (*_sysfatal)(char*, va_list); |
| threadmain(a->argc, a->argv); |
| threadexits("threadmain"); |
| main(int argc, char **argv) |
| * XXX Do daemonize hack here. |
| * Instruct QLock et al. to use our scheduling functions |
| * so that they can operate at the thread level. |
| _qlockinit(_threadsleep, _threadwakeup); |
| * Install our own _threadsysfatal which takes down |
| * the whole conglomeration of procs. |
| _sysfatal = _threadsysfatal; |
| * XXX Install our own jump handler. |
| * Install our own signal handlers. |
| * Construct the initial proc running mainlauncher(&a). |
| _newthread(p, mainlauncher, &a, mainstacksize, "threadmain", 0); |
| abort(); /* not reached */ |
| * No-op function here so that sched.o drags in main.o. |