Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. int pid;
  2. __asm__ __volatile__ (
  3. "movl $2, %%eax\n"
  4. "int $0x80\n"
  5. "movl %%eax,%0\n"
  6. "cmpl $0,%%eax\n"
  7. "jge else4\n"
  8. "neg %%eax\n"
  9. "movl %%eax,%1\n"
  10. "movl $-1,%0\n"
  11. "jmp endif4\n"
  12. "else4:\n"
  13. "movl %%eax,%0\n"
  14. "endif4:"
  15. :"=g" (pid), "=g" (errno)
  16. );
  17. return pid;
Add Comment
Please, Sign In to add comment