Mail Archives: djgpp-workers/2002/02/10/08:06:31
Hello.
Eli Zaretskii wrote:
>
> On Fri, 8 Feb 2002, Richard Dawe wrote:
[snip]
> > Since we don't support fork(), I don't see how we can support
> > posix_spawn*().
[snip]
> So posix_spawn* functions allow us to comply to Posix functionality in a
> way that makes porting the original code a snap, if compared to what you
> need to do with a program that used fork/exec. Unlike fork, which always
> fails in DJGPP, we can make these functions work as expected, at least for
> programs that don't require the parent and the child to run concurrently.
OK, maybe I'm too idealistic and want it to be perfect. ;)
I cannot see anything in the spec for posix_spawn* that allows you to tell it
to spawn a program and then wait for it to return. Presumably a program that
wanted to wait for the program to return would posix_spawn()/posix_spawnp()
and then wait() for the child to terminate. So would posix_spawn* work
something like this for DJGPP?
Program calls posix_spawn*
posix_spawn* save some random pid somewhere
posix_spawn* calls normal spawn* to handle process invocation
Spawned process runs, terminates
posix_spawn* save the exit code somewhere
posix_spawn* returns the random pid
Program calls wait
wait retrieves saved random pid and exit code, returns them to program
> > Why does gettext need these functions?
>
> Because it invokes subsidiary programs to do certain jobs.
I guessed that. 8) But I meant is it vital to gettext's functionality? Or is
there an easy work-around for DJGPP? (I guess we could just use spawn*
instead, for DJGPP.)
Juan - does it wait for the child programs to terminate?
FWIW glibc 2.1.3 on Linux does not seem to have posix_spawn*. I can't believe
gettext has shipped without being tested on any RedHat Linux 6.2 boxen. There
must be some code in gettext for platforms that don't support posix_spawn
(perhaps a wrapper that uses fork & exec ;) ).
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -