Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: Re: execv bug???]



In message <email@hidden>, Steve writes:
>So, are you suggesting then it could well be a bug with Leopard (it
>works fine on Tiger and, it works fine as coded by simply removing the
>v from vfork)? Obviously, the simple solution on Leopard for now is to
>use fork. I shall proceed to make a small test program and submit to
>Apple then.

I wouldn't consider it a significant bug; vfork is deprecated, having been
a performance hack to improve performance on the VAX.  The existence of
modern systems with copy-on-write semantics makes it a waste of time to try
to make things work with vfork; further, I wouldn't necessarily expect either
process to be stable after calling vfork and then doing anything other than
exec* and exit -- there's nothing I know of stating that chdir() calls
can't have side-effects that include modification of the caller's address
space in some way, and you should never call anything that modifies the
caller's address space from the child side of a vfork.

See the vfork man page:

     [EINVAL]           A system call other than _exit() or execve() (or libc
                        functions that make no system calls other than those)
                        is called following calling a vfork() call.

chdir() is a syscall.  It is an error to call chdir() inside the child of a
vfork.

-s
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >[Fwd: Re: execv bug???] (From: Steve <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.