void thread_exit(void) { irq_disable(); current_thread->state = TASK_FINISHED; irq_enable(); /* this call also enables IRQs */ switch_next(); }
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; } }