Fixed stack changing in SYS_CLONE
[tpg/acess2.git] / Usermode / Applications / init_src / main.c
index 55c4801..b205e3b 100644 (file)
@@ -22,14 +22,13 @@ int main(int argc, char *argv[])
        write(1, 13, "Hello, World!");
        
        tid = clone(CLONE_VM, 0);
+       __asm__ __volatile__("xchg %%bx, %%bx"::"a"(tid));
        if(tid == 0)
        {
                execve(DEFAULT_SHELL, NULL, NULL);
                for(;;) __asm__ __volatile__("hlt");
        }
        
-       __asm__ __volatile__("xchg %%bx, %%bx"::"a"(tid));
-       
        for(;;) sleep();
        
        return 42;

UCC git Repository :: git.ucc.asn.au