7 * Copyright (c) 1996 Open Market, Inc.
10 * This file contains proprietary and confidential information and
11 * remains the unpublished property of Open Market, Inc. Use,
12 * disclosure, or reproduction is prohibited except as permitted by
13 * express written license agreement with Open Market, Inc.
16 * snapper@openmarket.com
22 #define OS_Errno GetLastError()
23 #define OS_SetErrno(err) SetLastError(err)
25 #define DLLAPI __declspec(dllimport)
29 #define OS_Errno errno
30 #define OS_SetErrno(err) errno = (err)
38 #define STDIN_FILENO 0
43 #define STDOUT_FILENO 1
47 #define STDERR_FILENO 2
51 #define MAXPATHLEN 1024
60 #define O_NONBLOCK 0x0004 /* no delay */
64 #if defined (c_plusplus) || defined (__cplusplus)
69 # if defined(__STDC__) || defined(__cplusplus)
70 typedef void *ClientData;
72 typedef int *ClientData;
73 # endif /* __STDC__ */
77 typedef void (*OS_AsyncProc) (ClientData clientData, int len);
79 DLLAPI int OS_LibInit(int stdioFds[3]);
80 DLLAPI void OS_LibShutdown(void);
81 DLLAPI int OS_CreateLocalIpcFd(char *bindPath);
82 DLLAPI int OS_FcgiConnect(char *bindPath);
83 DLLAPI int OS_Read(int fd, char * buf, size_t len);
84 DLLAPI int OS_Write(int fd, char * buf, size_t len);
85 DLLAPI int OS_SpawnChild(char *execPath, int listenFd);
86 DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr,
87 ClientData clientData);
88 DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len,
89 OS_AsyncProc procPtr, ClientData clientData);
90 DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len,
91 OS_AsyncProc procPtr, ClientData clientData);
92 DLLAPI int OS_Close(int fd);
93 DLLAPI int OS_CloseRead(int fd);
94 DLLAPI int OS_DoIo(struct timeval *tmo);
95 DLLAPI int OS_FcgiIpcAccept(char *clientAddrList);
96 DLLAPI int OS_IpcClose(int ipcFd);
97 DLLAPI int OS_IsFcgi(void);
98 DLLAPI void OS_SetFlags(int fd, int flags);
100 #if defined (__cplusplus) || defined (c_plusplus)
101 } /* terminate extern "C" { */
104 #endif /* _FCGIOS_H */