[PATCH] getpid/vfork/raise fix
Jakub Jelinek
jakub@redhat.com
Wed Mar 10 17:02:00 GMT 2004
On Wed, Mar 10, 2004 at 08:38:12AM -0800, David Mosberger wrote:
> >>>>> On Wed, 10 Mar 2004 15:33:05 +0100, Andreas Schwab <schwab@suse.de> said:
>
> Andreas> That doesn't seem to work, though. I'm getting p3 != p4 in
> Andreas> the posix vfork tests. Or do you see any error in my
> Andreas> implementation?
>
> Most scratch registers are _not_ preserved across system calls. You
> could spill the register onto the memory stack though. If it uses at
> most 16 bytes, you won't have to adjust the stack pointer even.
But as soon as you spill something into memory the vfork child can clobber
it and you restore in the parent something different from what you saved.
Jakub
More information about the Libc-hacker
mailing list