[PATCH] getpid/vfork/raise fix

Jakub Jelinek jakub@redhat.com
Wed Mar 10 15:01:00 GMT 2004


On Wed, Mar 10, 2004 at 03:33:05PM +0100, Andreas Schwab wrote:
> That doesn't seem to work, though.  I'm getting p3 != p4 in the posix
> vfork tests.  Or do you see any error in my implementation?

Yes.

> ENTRY(__vfork)
> 	alloc r2=ar.pfs,0,0,2,0
> 	adds r14=PID,r13
> 	;; 
> 	ld4 r16=[r14]
> 	;;
> 	sub r15=0,r16
> 	cmp.eq p0,p6=0,r16

This line should read
	cmp.eq p6,p0=0,r16
instead.
You want to set ->pid to 0x80000000 if ->pid has been previously 0, not
non-zero.
With this change both tst-vfork1.c and tst-vfork2.c pass for me
(well, I was testing with a LD_PRELOAD'ed lib containing just this assembly,
did not want to build full ia64 glibc).

	Jakub



More information about the Libc-hacker mailing list