Changeset bfd1546 in mainline for uspace/lib/libc/generic/loader.c


Ignore:
Timestamp:
2009-02-15T00:01:06Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08b777e
Parents:
4cac212c
Message:

More elegant way of invoking the loader - as a 'cloneable' service. Task names functionality lost for the time being.

File:
1 edited

Legend:

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

    r4cac212c rbfd1546  
    3535#include <ipc/ipc.h>
    3636#include <ipc/loader.h>
     37#include <ipc/services.h>
    3738#include <libc.h>
    3839#include <task.h>
     
    5152 *              de-allocated using free() after use).
    5253 */
    53 loader_t *loader_spawn(const char *name)
    54 {
    55         int phone_id, rc;
     54int loader_spawn(const char *name)
     55{
     56        return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
     57            (sysarg_t) name, strlen(name));
     58}
     59
     60loader_t *loader_connect(void)
     61{
    5662        loader_t *ldr;
    57 
    58         /*
    59          * Ask kernel to spawn a new loader task.
    60          */
    61         rc = __SYSCALL3(SYS_PROGRAM_SPAWN_LOADER, (sysarg_t) &phone_id,
    62                 (sysarg_t) name, strlen(name));
    63         if (rc != 0)
    64                 return NULL;
    65 
    66         /*
    67          * Say hello so that the loader knows the incoming connection's
    68          * phone hash.
    69          */
    70         rc = async_req_0_0(phone_id, LOADER_HELLO);
    71         if (rc != EOK)
     63        int phone_id;
     64
     65        phone_id = ipc_connect_me_to(PHONE_NS, SERVICE_LOAD, 0, 0);
     66        if (phone_id < 0)
    7267                return NULL;
    7368
     
    7772
    7873        ldr->phone_id = phone_id;
    79         return ldr;
     74        return ldr;     
    8075}
    8176
Note: See TracChangeset for help on using the changeset viewer.