bitwiseworks / libcx

kLIBC Extension Library
GNU Lesser General Public License v2.1
11 stars 1 forks source link

Add spawn2ex function #65

Open dmik opened 5 years ago

dmik commented 5 years ago

We need an extended version of spawn2 that takes a pointer to a STARTDATA structure (used by DosStartSession). The reason for that is that there are situations when the caller wants to have better control over the started session other than provided with various P_* flags (like P_FULLSCREEN and so on). One real life example is https://github.com/bitwiseworks/qtbase-os2/issues/66.

The new interface will be just like spawn2 but take an additional argument with the pointer to STARTDATA.

dmik commented 5 years ago

Note that although the original EMX spawn handles the termination queue on its own: it uses it to implement wait and waitpid for sessions. We might do the same in our spawn2 one day but for Qt it's better to have more detailed control because QProcess already runs its own thread to monitor for child pipes and monitoring the termination queue fits perfectly there.

dmik commented 5 years ago

Note that tst-spawn2.c should be enhanced to cover P_SESSION other flags as part of this ticket. And there should be also a separate test named tst-spawn2ex.c to cover the extended version separately.