Changeset c98e6ee in mainline for uspace/lib/libc/generic/libc.c


Ignore:
Timestamp:
2008-07-08T16:05:45Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f93f168
Parents:
b7f9087
Message:

Merge program-loader related stuff from dynload branch to trunk. (huge)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/libc.c

    rb7f9087 rc98e6ee  
    4949#include <async.h>
    5050#include <as.h>
     51#include <loader/pcb.h>
    5152
    5253extern char _heap;
     54extern int main(int argc, char *argv[]);
    5355
    5456void _exit(int status)
     
    5759}
    5860
    59 void __main(void)
     61void __main(void *pcb_ptr)
    6062{
    6163        fibril_t *f;
     64        int argc;
     65        char **argv;
    6266
    6367        (void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ);
     
    6771       
    6872        open_console();
     73
     74        /* Save the PCB pointer */
     75        __pcb = (pcb_t *)pcb_ptr;
     76
     77        if (__pcb == NULL) {
     78                argc = 0;
     79                argv = NULL;
     80        } else {
     81                argc = __pcb->argc;
     82                argv = __pcb->argv;
     83        }
     84
     85        main(argc, argv);
    6986}
    7087
Note: See TracChangeset for help on using the changeset viewer.