1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
.globl _waitpid .globl waitpid _waitpid: waitpid: pushfl popl %eax orl $0x8c4,%eax pushl %eax popfl movl $0x7, %eax lcall $7,$0 jb _cerror movl 8(%esp), %ecx testl %ecx, %ecx je bye movl %edx, (%ecx) bye: ret