#include <sys/time.h>
#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
#if defined (c_plusplus) || defined (__cplusplus)
extern "C" {
#endif
#ifdef _WIN32
#define OS_Errno GetLastError()
#define OS_SetErrno(err) SetLastError(err)
-#ifndef DLLAPI
-#define DLLAPI __declspec(dllimport)
-#endif
#ifndef O_NONBLOCK
#define O_NONBLOCK 0x0004 /* no delay */
#endif
#else /* !_WIN32 */
-#define DLLAPI
#define OS_Errno errno
#define OS_SetErrno(err) errno = (err)
#endif /* !_WIN32 */
+#ifndef DLLAPI
+#ifdef _WIN32
+#define DLLAPI __declspec(dllimport)
+#else
+#define DLLAPI
+#endif
+#endif
+
+
/* This is the initializer for a "struct timeval" used in a select() call
* right after a new request is accept()ed to determine readablity. Its
* a drop-dead timer. Its only used for AF_UNIX sockets (not TCP sockets).
DLLAPI int OS_Write(int fd, char * buf, size_t len);
DLLAPI int OS_SpawnChild(char *execPath, int listenFd);
DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr,
- ClientData clientData);
+ ClientData clientData);
DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len,
- OS_AsyncProc procPtr, ClientData clientData);
+ OS_AsyncProc procPtr, ClientData clientData);
DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len,
- OS_AsyncProc procPtr, ClientData clientData);
-DLLAPI int OS_Close(int fd);
+ OS_AsyncProc procPtr, ClientData clientData);
+DLLAPI int OS_Close(int fd, int shutdown);
DLLAPI int OS_CloseRead(int fd);
DLLAPI int OS_DoIo(struct timeval *tmo);
DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs);
-DLLAPI int OS_IpcClose(int ipcFd);
+DLLAPI int OS_IpcClose(int ipcFd, int shutdown);
DLLAPI int OS_IsFcgi(int sock);
DLLAPI void OS_SetFlags(int fd, int flags);
+DLLAPI void OS_ShutdownPending(void);
+
#if defined (__cplusplus) || defined (c_plusplus)
} /* terminate extern "C" { */
#endif