コード例 #1
0
ファイル: thread.c プロジェクト: jo-va/toutatis
void thread_exit(void)
{
    irq_disable();
    current_thread->state = TASK_FINISHED;
    irq_enable();

    /* this call also enables IRQs */
    switch_next();
}
コード例 #2
0
ファイル: elf.c プロジェクト: jacklgentooman/osdev
int
system(
    char *  path, /* Path to the executable to run */
    int     argc, /* Argument count (ie, /bin/echo hello world = 3) */
    char ** argv  /* Argument strings (including executable path) */
) {
    int child = fork();
    if (child == 0) {
        char * env[] = {NULL};
        exec(path,argc,argv,env);
        debug_print(ERROR, "Failed to execute process!");
        kexit(-1);
        return -1;
    } else {
        switch_next();
        return -1;
    }
}