Remove references in the comments to fcgio2.h.
[catagits/fcgi2.git] / include / fcgios.h
CommitLineData
ee03fac4 1/*
0198fd3c 2 * fcgios.h --
3 *
4 * Description of file.
5 *
6 *
7 * Copyright (c) 1996 Open Market, Inc.
8 * All rights reserved.
9 *
10 * This file contains proprietary and confidential information and
ee03fac4 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.
0198fd3c 14 *
15 * Bill Snapper
16 * snapper@openmarket.com
17 */
18#ifndef _FCGIOS_H
19#define _FCGIOS_H
20
344bf056 21#include "fcgi_config.h"
22
344bf056 23#ifdef HAVE_SYS_TIME_H
24#include <sys/time.h>
25#endif
26
5d581fb3 27#ifdef HAVE_WINDOWS_H
28#include <windows.h>
29#endif
30
344bf056 31#if defined (c_plusplus) || defined (__cplusplus)
32extern "C" {
33#endif
34
344bf056 35#ifdef _WIN32
0198fd3c 36#define OS_Errno GetLastError()
37#define OS_SetErrno(err) SetLastError(err)
38#ifndef DLLAPI
39#define DLLAPI __declspec(dllimport)
40#endif
344bf056 41#ifndef O_NONBLOCK
42#define O_NONBLOCK 0x0004 /* no delay */
fdb63fa0 43#endif
344bf056 44#else /* !_WIN32 */
0198fd3c 45#define DLLAPI
46#define OS_Errno errno
47#define OS_SetErrno(err) errno = (err)
344bf056 48#endif /* !_WIN32 */
0198fd3c 49
4a7222d7 50/* This is the initializer for a "struct timeval" used in a select() call
51 * right after a new request is accept()ed to determine readablity. Its
52 * a drop-dead timer. Its only used for AF_UNIX sockets (not TCP sockets).
53 * Its a workaround for a kernel bug in Linux 2.0.x and SCO Unixware.
54 * Making this as small as possible, yet remain reliable would be best.
ee03fac4 55 * 2 seconds is very conservative. 0,0 is not reliable. The shorter the
4a7222d7 56 * timeout, the faster request processing will recover. The longer the
57 * timeout, the more likely this application being "busy" will cause other
58 * requests to abort and cause more dead sockets that need this timeout. */
59#define READABLE_UNIX_FD_DROP_DEAD_TIMEVAL 2,0
60
0198fd3c 61#ifndef STDIN_FILENO
62#define STDIN_FILENO 0
63#endif
64
0198fd3c 65#ifndef STDOUT_FILENO
66#define STDOUT_FILENO 1
67#endif
68
69#ifndef STDERR_FILENO
70#define STDERR_FILENO 2
71#endif
72
73#ifndef MAXPATHLEN
74#define MAXPATHLEN 1024
75#endif
76
77#ifndef X_OK
78#define X_OK 0x01
79#endif
80
0198fd3c 81#ifndef _CLIENTDATA
82# if defined(__STDC__) || defined(__cplusplus)
83 typedef void *ClientData;
84# else
85 typedef int *ClientData;
86# endif /* __STDC__ */
87#define _CLIENTDATA
88#endif
89
90typedef void (*OS_AsyncProc) (ClientData clientData, int len);
91
92DLLAPI int OS_LibInit(int stdioFds[3]);
93DLLAPI void OS_LibShutdown(void);
0b7c9662 94DLLAPI int OS_CreateLocalIpcFd(const char *bindPath, int backlog);
0198fd3c 95DLLAPI int OS_FcgiConnect(char *bindPath);
96DLLAPI int OS_Read(int fd, char * buf, size_t len);
97DLLAPI int OS_Write(int fd, char * buf, size_t len);
98DLLAPI int OS_SpawnChild(char *execPath, int listenFd);
ee03fac4 99DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr,
0198fd3c 100 ClientData clientData);
101DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len,
102 OS_AsyncProc procPtr, ClientData clientData);
ee03fac4 103DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len,
0198fd3c 104 OS_AsyncProc procPtr, ClientData clientData);
105DLLAPI int OS_Close(int fd);
106DLLAPI int OS_CloseRead(int fd);
107DLLAPI int OS_DoIo(struct timeval *tmo);
1dd5d7a8 108DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs);
0198fd3c 109DLLAPI int OS_IpcClose(int ipcFd);
0b7c9662 110DLLAPI int OS_IsFcgi(int sock);
0198fd3c 111DLLAPI void OS_SetFlags(int fd, int flags);
112
113#if defined (__cplusplus) || defined (c_plusplus)
114} /* terminate extern "C" { */
115#endif
116
117#endif /* _FCGIOS_H */