This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: using spawn functions to avoid fork() errors
- From: David Conrad <DavidConrad at acm dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 6 Feb 2014 17:53:12 -0500
- Subject: Re: using spawn functions to avoid fork() errors
- Authentication-results: sourceware.org; auth=none
- References: <000001cf226a$e8d47830$ba7d6890$ at lbmsys dot com> <52F2606E dot 4030204 at cygwin dot com> <012a01cf2342$6d7dd310$48797930$ at lbmsys dot com> <52F3E1C4 dot 4020801 at cygwin dot com> <025f01cf2388$d2542cd0$76fc8670$ at lbmsys dot com> <52F40DE5 dot 4060800 at cygwin dot com>
>>> On 2/6/2014 8:50 AM, Steven Bardwell wrote:
>>>> However, on my 64-bit install, the spawnv() call is returning with an
>>>> error -- 'No such file or directory' -- when I try to spawn /bin/sh.
A few things come to mind as possibilities to check, or try. First,
there is a certain amount of magic that cygwin does to treat
/bin/sh.exe and /bin/sh the same. What happens if you spawn
/bin/sh.exe instead of /bin/sh? Second, what happens if you use
spawnvp instead of spawnv? Although, from the strace excerpt it
doesn't look like it's actually having trouble finding the executable,
so those probably aren't it. Still, worth checking, perhaps.
Third, are you certain you are NULL-terminating the array of
arguments? If you aren't doing so explicitly, it is possible there
happened to be a NULL pointer just after the arguments in memory for
the 32-bit version, so it happened to work, but that didn't happen for
the 64-bit version. The argv array must have a NULL at the end of it.
Fourth, what are you passing to the mode parameter of spawnv?
Or, fifth, I dunno what the problem is. Those are my only ideas. Good luck.
David
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple