Re: sys_fork
Frank Kotler <[email protected]>
| Newsgroups | org.kernel.vger.linux-assembly |
|---|---|
| Message-ID | <[email protected]> |
HIToC wrote: ... > mov eax, 0x02 ; sys_fork > xor ebx, ebx > int 0x80 I don't know much about socket programming, but I got sys_fork to work, once... At this point, you're "two places at once". If eax=0, you're the child (and want to do the echo_loop stuff, I guess). If eax is non-zero - and positive, we hope! - you're the parent, and eax is the PID of the child. In this case, I guess you want to jump back to the "accept" call. By not checking eax at this point, *both* the parent and child fall through into the echo_loop... and the sys_exit. At least, I *think* that's what's happening... or eax, eax ; or "test eax, eax" js webefukt ; might be an error! jnz wait_new_con ; parent ... ; child See if something like that helps... There may be other things you need to do, besides just going back to "accept" (probably should clean up stack after the call?)... Best, Frank