Back to index

php5  5.3.10
fpm_config.h
Go to the documentation of this file.
00001 /* $Id: fpm_config.h,v 1.16 2008/05/25 00:30:43 anight Exp $ */
00002 /* (c) 2007,2008 Andrei Nigmatulin */
00003 
00004 #include <php_config.h>
00005 
00006 /* Solaris does not have it */
00007 #ifndef INADDR_NONE
00008 # define INADDR_NONE (-1)
00009 #endif
00010 
00011 
00012 /* If we're not using GNU C, elide __attribute__ */
00013 #ifndef __GNUC__
00014 # define __attribute__(x)  /*NOTHING*/
00015 #endif
00016 
00017 /* Missing timer* macros (for solaris) */
00018 #ifndef timerisset
00019 # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
00020 #endif
00021 
00022 #ifndef timerclear
00023 # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
00024 #endif
00025 
00026 #ifndef timersub
00027 # define timersub(tvp, uvp, vvp)                          \
00028        do {                                                  \
00029               (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;    \
00030               (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
00031               if ((vvp)->tv_usec < 0) {                         \
00032                      (vvp)->tv_sec--;                              \
00033                      (vvp)->tv_usec += 1000000;                    \
00034               }                                                 \
00035        } while (0)
00036 #endif
00037 
00038 #ifndef timeradd
00039 # define timeradd(a, b, result)                          \
00040        do {                                                 \
00041               (result)->tv_sec = (a)->tv_sec + (b)->tv_sec;    \
00042               (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
00043               if ((result)->tv_usec >= 1000000)                \
00044               {                                                \
00045                      ++(result)->tv_sec;                          \
00046                      (result)->tv_usec -= 1000000;                \
00047               }                                                \
00048        } while (0)
00049 #endif
00050 
00051 #ifndef timercmp
00052 /* does not work for >= and <= */
00053 # define timercmp(a, b, CMP)         \
00054   (((a)->tv_sec == (b)->tv_sec) ?    \
00055   ((a)->tv_usec CMP (b)->tv_usec) :  \
00056     ((a)->tv_sec CMP (b)->tv_sec))
00057 #endif
00058 /* endof timer* macros */
00059 
00060 #ifndef MIN
00061 # define MIN(a,b) (((a)<(b))?(a):(b))
00062 #endif
00063 
00064 #ifndef MAX
00065 # define MAX(a,b) (((a)>(b))?(a):(b))
00066 #endif
00067 
00068 #if defined(HAVE_PTRACE) || defined(PROC_MEM_FILE) || defined(HAVE_MACH_VM_READ)
00069 # define HAVE_FPM_TRACE 1
00070 #else
00071 # define HAVE_FPM_TRACE 0
00072 #endif
00073 
00074 #if defined(HAVE_LQ_TCP_INFO) || defined(HAVE_LQ_SO_LISTENQ)
00075 # define HAVE_FPM_LQ 1
00076 #else
00077 # define HAVE_FPM_LQ 0
00078 #endif
00079