ENH: Changes based on patch from Ryan C. Gordon to enable process execution on BeOS. There seems to be no way to implement it without polling (or threads).

This commit is contained in:
Brad King
2006-12-04 14:42:47 -05:00
parent d045ae45f2
commit de8ffcaef4
2 changed files with 382 additions and 149 deletions

View File

@@ -34,6 +34,17 @@
# pragma warn -8060 /* possibly incorrect assignment */
#endif
#if defined(__BEOS__) && !defined(__ZETA__)
/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
# include <be/kernel/OS.h>
static inline void testProcess_usleep(unsigned int msec)
{
snooze(msec);
}
#else
# define testProcess_usleep usleep
#endif
int runChild(const char* cmd[], int state, int exception, int value,
int share, int output, int delay, double timeout, int poll,
int repeat, int disown);
@@ -76,6 +87,9 @@ int test4(int argc, const char* argv[])
#if defined(_WIN32)
/* Avoid error diagnostic popups since we are crashing on purpose. */
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#elif defined(__BEOS__)
/* Avoid error diagnostic popups since we are crashing on purpose. */
disable_debugger(1);
#endif
(void)argc; (void)argv;
fprintf(stdout, "Output before crash on stdout from crash test.\n");
@@ -264,7 +278,7 @@ int runChild2(kwsysProcess* kp,
#if defined(_WIN32)
Sleep(100);
#else
usleep(100000);
testProcess_usleep(100000);
#endif
}
if(delay)