/* -*-C-*-
-$Id: nt.h,v 1.1 1993/02/10 22:39:46 adams Exp $
+$Id: nt.h,v 1.2 1993/06/24 01:42:39 gjr Exp $
Copyright (c) 1992-1993 Massachusetts Institute of Technology
#include <windows.h>
#include <sys/types.h>
+
+#ifdef WINNT
+#else
#include <sys/times.h>
+#endif
+
#include <dos.h>
#include <io.h>
#include <conio.h>
#include <limits.h>
#include <time.h>
-#include <termio.h>
+/*#include <termio.h>*/
#define HAVE_MKDIR
#define HAVE_RMDIR
/* #define HAVE_FCNTL */
#define VOID_SIGNAL_HANDLERS
-#include <sys/dir.h>
+/*#include <sys/dir.h>*/
+
\f
typedef void Tsignal_handler_result;
#define SIGNAL_HANDLER_RETURN() return
#define ALERT_STRING "\007"
#endif
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#define STDOUT_FILENO 1
-#define STDERR_FILENO 2
-#endif
+//#ifndef STDIN_FILENO
+//#define STDIN_FILENO 0
+//#define STDOUT_FILENO 1
+//#define STDERR_FILENO 2
+//#endif
+
+extern HANDLE STDIN_HANDLE, STDOUT_HANDLE, STDERR_HANDLE;
/* constants for open() and fcntl() */
#ifndef O_RDONLY
#ifndef WINNT
extern PTR EXFUN (malloc, (unsigned int size));
extern PTR EXFUN (realloc, (PTR ptr, unsigned int size));
-#endif
extern int EXFUN (gethostname, (char * name, unsigned int size));
+#endif
#ifdef HAVE_FCNTL
#define DOS_fcntl fcntl
#define STD_VOID_SYSTEM_CALL(name, expression) \
{ \
while ((expression) < 0) \
- error_system_call (errno, (name)); \
+ if (errno != EINTR) \
+ error_system_call (errno, (name)); \
+}
+
+#define STD_BOOL_SYSTEM_CALL(name, expression) \
+{ \
+ while (! (expression)) \
+ error_system_call (GetLastError(), (name)); \
+}
+
+#define STD_HANDLE_SYSTEM_CALL(name, result, expression) \
+{ \
+ while (((result) = (expression)) == INVALID_HANDLE_VALUE) \
+ error_system_call (GetLastError(), (name)); \
}
#define STD_UINT_SYSTEM_CALL(name, result, expression) \
{ \
- while (((result) = (expression)) < 0) \
+ while (((result) = (expression)) == 0) \
error_system_call (errno, (name)); \
}