This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] getpid/vfork/raise fix


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]