[klibc] unbreak vfork on cris architecture

Mike Frysinger vapier at gentoo.org
Mon Mar 21 10:01:23 PDT 2011


On Mon, Mar 21, 2011 at 11:14 AM, Thorsten Glaser wrote:
>>> your simple implementation is probably incorrect -- errno cannot be
>>> referenced directly.
>
> Mh. On the other hand, the manpage says:
>
>     In a multithreaded application,  vfork()  borrows  only  the
>     thread  of  control  that called vfork() in the parent; that
>     is, the child contains only one thread. The use  of  vfork()
>     in  multithreaded  applications,  however,  is unsafe due to
>     race conditons that can cause the child  process  to  become
>     deadlocked  and consequently block both the child and parent
>     process from execution indefinitely.

which is irrelevant in the case of updating errno -- the vfork failed
and thus no 2nd process is running

> But if that’s a concern… fix it

i have nothing to do with cris.  but the answer here is not "fix it"
but rather "patch not merged".  no sweat off my back since i dont have
any cris hardware.

> He found a problem and a WFM-style fix, which at
> least improves the situation.

then file a bug in bugzilla so someone else will fix it eventually

> By all means, replace the errno
> access with a jump to __syscall_error after setting up registers
> in a way that routine (from sysdeps/linux/cris/sysdep.S) expects
> it; I don’t know cris assembly but it doesn’t look _too_ hard…

tailing to __syscall_error is probably a wise decision
-mike



More information about the klibc mailing list