Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4054 → Rev 4055

/branches/dd/uspace/lib/libc/generic/libc.c
48,28 → 48,41
#include <ipc/ipc.h>
#include <async.h>
#include <as.h>
#include <loader/pcb.h>
 
extern char _heap;
extern int main(int argc, char *argv[]);
 
int _errno;
 
void _exit(int status)
{
thread_exit(status);
}
 
void __main(void)
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();
f = fibril_setup();
__tcb_set(f->tcb);
}
/* Save the PCB pointer */
__pcb = (pcb_t *)pcb_ptr;
 
void __io_init(void)
{
open_stdin();
open_stdout();
if (__pcb == NULL) {
argc = 0;
argv = NULL;
} else {
argc = __pcb->argc;
argv = __pcb->argv;
}
 
main(argc, argv);
}
 
void __exit(void)