Esempio n. 1
0
void
umain(void)
{
    envid_t who;
    int i;
    // fork a child process
    i = 100;
    who = dumbfork();
    // print a message and yield to the other a few times
    for (i = 0; i < (who ? 10 : 20); i++) {
        cprintf("%d: I am the %s!\n", i, who ? "parent" : "child");
        sys_yield();
    }
}
Esempio n. 2
0
void
umain(int argc, char **argv)
{
	envid_t who;
	int i;

	// fork a child process
	who = dumbfork();
	cprintf("who = %0x\n", who);
	// print a message and yield to the other a few times
	for (i = 0; i < (who ? 10 : 20); i++) {
		cprintf("%d: I am the %s!\n", i, who ? "parent" : "child");
		sys_yield();
	}
}