added OS/2 code into time.c
started writing OS/2 code into pio.c fixed minor issues in fio.c
This commit is contained in:
@ -26,6 +26,9 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#if defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <signal.h>
|
||||
@ -86,9 +89,12 @@ public:
|
||||
|
||||
if (run.setGlobal (idLastSleep, x) <= -1) return -1;
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
::Sleep ((DWORD)(x * 1000));
|
||||
return ret.setInt (0);
|
||||
#elif defined(__OS2__)
|
||||
::DosSleep ((ULONG)(x * 1000));
|
||||
return ret.setInt (0);
|
||||
#else
|
||||
return ret.setInt (::sleep (x));
|
||||
#endif
|
||||
|
@ -4,8 +4,12 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# define INCL_DOSERRORS
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <sys/wait.h>
|
||||
@ -245,7 +249,7 @@ static int test9 (void)
|
||||
pio = qse_pio_open (
|
||||
QSE_NULL,
|
||||
0,
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
QSE_T(".\\sll.exe"),
|
||||
#else
|
||||
QSE_T("/bin/ls -laF"),
|
||||
@ -258,7 +262,7 @@ static int test9 (void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
{
|
||||
int n = 5;
|
||||
|
||||
@ -267,6 +271,17 @@ static int test9 (void)
|
||||
qse_printf (QSE_T("WaitForSingleObject....%d\n"),
|
||||
WaitForSingleObject (pio->child, 0));
|
||||
}
|
||||
#elif defined(__OS2__)
|
||||
{
|
||||
int n = 5;
|
||||
|
||||
#error NO IMPLEMENTED YET.
|
||||
qse_printf (QSE_T("sleeping for %d seconds\n"), n);
|
||||
DosSleep (n * 1000);
|
||||
qse_printf (QSE_T("WaitForSingleObject....%d\n"),
|
||||
WaitForSingleObject (pio->child, 0));
|
||||
DosWaitChild (DCWA_PROCESS, DCWW_WAIT,..);
|
||||
}
|
||||
#else
|
||||
{
|
||||
int status;
|
||||
|
Reference in New Issue
Block a user