From: Frank Kotler <fbkotler@comcast.net>
To: linux-assembly@vger.kernel.org
Subject: Re: sys_fork
Date: Mon, 28 Nov 2005 13:48:40 +0000 [thread overview]
Message-ID: <438B0AB8.6080304@comcast.net> (raw)
In-Reply-To: <200511281110.51363.hitoc_mail@yahoo.it>
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
next prev parent reply other threads:[~2005-11-28 13:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-26 17:06 sys_fork HIToC
2005-11-26 17:23 ` sys_fork Ricardo Nabinger Sanchez
2005-11-26 19:26 ` sys_fork Claudio Fontana
2005-11-27 18:22 ` sys_fork HIToC
2005-11-27 19:27 ` sys_fork Ricardo Nabinger Sanchez
2005-11-28 10:10 ` sys_fork HIToC
2005-11-28 13:48 ` Frank Kotler [this message]
2005-11-28 19:25 ` sys_fork Ricardo Nabinger Sanchez
2005-11-29 18:59 ` sys_fork HIToC
2005-11-30 0:20 ` sys_fork Ricardo Nabinger Sanchez
2005-11-30 4:00 ` sys_fork Robert Plantz
2005-11-30 10:26 ` sys_fork Ricardo Nabinger Sanchez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438B0AB8.6080304@comcast.net \
--to=fbkotler@comcast.net \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).