Subversion Repositories HelenOS

Rev

Rev 3536 | Rev 4377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3536 Rev 3597
Line 44... Line 44...
44
#include <loader/loader.h>
44
#include <loader/loader.h>
45
 
45
 
46
/** Connect to a new program loader.
46
/** Connect to a new program loader.
47
 *
47
 *
48
 * Spawns a new program loader task and returns the connection structure.
48
 * Spawns a new program loader task and returns the connection structure.
-
 
49
 * @param name  Symbolic name to set on the newly created task.
49
 * @return  Pointer to the loader connection structure (should be
50
 * @return  Pointer to the loader connection structure (should be
50
 *      de-allocated using free() after use).
51
 *      de-allocated using free() after use).
51
 */
52
 */
52
loader_t *loader_spawn(void)
53
loader_t *loader_spawn(char *name)
53
{
54
{
54
    int phone_id, rc;
55
    int phone_id, rc;
55
    loader_t *ldr;
56
    loader_t *ldr;
56
 
57
 
57
    /*
58
    /*
58
     * Ask kernel to spawn a new loader task.
59
     * Ask kernel to spawn a new loader task.
59
     */
60
     */
60
    rc = __SYSCALL1(SYS_PROGRAM_SPAWN_LOADER, (sysarg_t) &phone_id);
61
    rc = __SYSCALL3(SYS_PROGRAM_SPAWN_LOADER, (sysarg_t) &phone_id,
-
 
62
        (sysarg_t) name, strlen(name));
61
    if (rc != 0)
63
    if (rc != 0)
62
        return NULL;
64
        return NULL;
63
 
65
 
64
    /*
66
    /*
65
     * Say hello so that the loader knows the incoming connection's
67
     * Say hello so that the loader knows the incoming connection's