On Windows, it is returned as-is, thus it should read:
set S1, 'perl -e "exit(123)"'
set I1, 99
spawnw I1, S1
print "return code: "
print I1
print "\n"
end
The documentation for spawnw (F<ops/sys.ops>) says:
Spawn a subprocess and wait for it to finish. The return status,
which is very system-dependent, goes in $1.
Thus, I guess the place to change is F<t/ops/spawnw.t>. Should I skip
the original tests on Windows, and add Windows specific ones (that are
run only there)?
Ron
[ code snippet ]
> The documentation for spawnw (F<ops/sys.ops>) says:
> Spawn a subprocess and wait for it to finish. The return status,
> which is very system-dependent, goes in $1.
Yeah. What does Perl5?
> Thus, I guess the place to change is F<t/ops/spawnw.t>. Should I skip
> the original tests on Windows, and add Windows specific ones (that are
> run only there)?
Or provide a more unified view of the result?
> Ron
leo
$?
"This is just the 16-bit status word returned by the wait() system call
(or else is made up to look like it)."
>> Thus, I guess the place to change is F<t/ops/spawnw.t>. Should I skip
>> the original tests on Windows, and add Windows specific ones (that are
>> run only there)?
> Or provide a more unified view of the result?
That's what I am thinking. I'd even return something more structured
than a "16-bit status word," with
"the exit value of the subprocess is really ("$? >> 8"), and "$? &
127" gives which signal, if any, the process died from, and "$? & 128"
reports whether there was a core dump."
The platform specific implementations seem to be the best place to
handle _all_ platform differences, including input parameter,
execution, and return values.
Ron