Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3003 → Rev 3004

/branches/dynload/uspace/lib/libc/generic/task.c
33,7 → 33,9
*/
 
#include <task.h>
#include <libc.h>
#include <ipc/ipc.h>
#include <async.h>
#include <errno.h>
 
task_id_t task_get_id(void)
{
44,5 → 46,50
return task_id;
}
 
static int task_spawn_loader(void)
{
int phone_id, rc;
 
rc = __SYSCALL1(SYS_TASK_SPAWN, (sysarg_t) &phone_id);
if (rc != 0)
return rc;
 
return phone_id;
}
#include <stdio.h>
#include <unistd.h>
task_id_t task_spawn(const char *path, const char *argv[])
{
int phone_id;
ipc_call_t answer;
aid_t req;
int rc;
phone_id = task_spawn_loader();
if (phone_id < 0) return 0;
printf("phone_id:%d\n", phone_id);
 
// getchar();
 
// req = async_send_0(phone_id, 1024, &answer);
rc = ipc_data_write_start(phone_id, (void *)path, strlen(path));
printf("->%d\n", rc);
if (rc != EOK) {
// async_wait_for(req, NULL);
return 1;
}
// async_wait_for(req, &rc);
 
if (rc != EOK) return 0;
// rc = async_req_0_0(phone_id, 1025);
// printf("->%d\n", rc);
// if (rc != EOK) return 0;
 
// ipc_hangup(phone_id);
 
return 1;
}
 
/** @}
*/