/branches/dynload/uspace/lib/libc/generic/libc.c/libc.c |
---|
51,6 → 51,7 |
#include <loader/pcb.h> |
extern char _heap; |
extern int main(int argc, char *argv[]); |
void _exit(int status) |
{ |
60,6 → 61,8 |
void __main(void *pcb_ptr) |
{ |
fibril_t *f; |
int argc; |
char **argv; |
(void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ); |
_async_init(); |
67,6 → 70,19 |
__tcb_set(f->tcb); |
open_console(); |
/* Save the PCB pointer */ |
__pcb = (pcb_t *)pcb_ptr; |
if (__pcb == NULL) { |
argc = 0; |
argv = NULL; |
} else { |
argc = __pcb->argc; |
argv = __pcb->argv; |
} |
main(argc, argv); |
} |
void __exit(void) |