X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Ffcgios.h;h=6c33638ef0c2434760f7f445c15b1d3ec8e7339d;hb=344bf0566f5fc2d789dbca4a988cef35c68af497;hp=d4684c524b31a63a7e0798fc5c1eac3cdd8f09fd;hpb=4a7222d72a015d25ef141e73d7e82c2ae27cbfac;p=catagits%2Ffcgi2.git diff --git a/include/fcgios.h b/include/fcgios.h index d4684c5..6c33638 100755 --- a/include/fcgios.h +++ b/include/fcgios.h @@ -1,4 +1,4 @@ -/* +/* * fcgios.h -- * * Description of file. @@ -8,9 +8,9 @@ * All rights reserved. * * This file contains proprietary and confidential information and - * remains the unpublished property of Open Market, Inc. Use, - * disclosure, or reproduction is prohibited except as permitted by - * express written license agreement with Open Market, Inc. + * remains the unpublished property of Open Market, Inc. Use, + * disclosure, or reproduction is prohibited except as permitted by + * express written license agreement with Open Market, Inc. * * Bill Snapper * snapper@openmarket.com @@ -18,30 +18,48 @@ #ifndef _FCGIOS_H #define _FCGIOS_H +#include "fcgi_config.h" + +#ifdef _WIN32 +#include +#endif + +#ifdef HAVE_SYS_TIME_H #include +#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 -#else + +#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 -#ifdef _WIN32 -#include -#endif +#endif /* !_WIN32 */ /* 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). * Its a workaround for a kernel bug in Linux 2.0.x and SCO Unixware. * Making this as small as possible, yet remain reliable would be best. - * 2 seconds is very conservative. 0,0 is not reliable. The shorter the + * 2 seconds is very conservative. 0,0 is not reliable. The shorter the * timeout, the faster request processing will recover. The longer the * timeout, the more likely this application being "busy" will cause other * requests to abort and cause more dead sockets that need this timeout. */ @@ -51,7 +69,6 @@ #define STDIN_FILENO 0 #endif - #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif @@ -68,16 +85,6 @@ #define X_OK 0x01 #endif -#ifdef _WIN32 -#ifndef O_NONBLOCK -#define O_NONBLOCK 0x0004 /* no delay */ -#endif -#endif - -#if defined (c_plusplus) || defined (__cplusplus) -extern "C" { -#endif - #ifndef _CLIENTDATA # if defined(__STDC__) || defined(__cplusplus) typedef void *ClientData; @@ -96,11 +103,11 @@ DLLAPI int OS_FcgiConnect(char *bindPath); DLLAPI int OS_Read(int fd, char * buf, size_t len); 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, +DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr, ClientData clientData); DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len, OS_AsyncProc procPtr, ClientData clientData); -DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len, +DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len, OS_AsyncProc procPtr, ClientData clientData); DLLAPI int OS_Close(int fd); DLLAPI int OS_CloseRead(int fd);