1 /* $Id: fpm_config.h,v 1.16 2008/05/25 00:30:43 anight Exp $ */ 2 /* (c) 2007,2008 Andrei Nigmatulin */ 3 4 #include <php_config.h> 5 6 /* Solaris does not have it */ 7 #ifndef INADDR_NONE 8 # define INADDR_NONE (-1) 9 #endif 10 11 12 /* If we're not using GNU C, elide __attribute__ */ 13 #ifndef __GNUC__ 14 # define __attribute__(x) /*NOTHING*/ 15 #endif 16 17 /* Missing timer* macros (for solaris) */ 18 #ifndef timerisset 19 # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 20 #endif 21 22 #ifndef timerclear 23 # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) 24 #endif 25 26 #ifndef timersub 27 # define timersub(tvp, uvp, vvp) \ 28 do { \ 29 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ 30 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ 31 if ((vvp)->tv_usec < 0) { \ 32 (vvp)->tv_sec--; \ 33 (vvp)->tv_usec += 1000000; \ 34 } \ 35 } while (0) 36 #endif 37 38 #ifndef timeradd 39 # define timeradd(a, b, result) \ 40 do { \ 41 (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ 42 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ 43 if ((result)->tv_usec >= 1000000) \ 44 { \ 45 ++(result)->tv_sec; \ 46 (result)->tv_usec -= 1000000; \ 47 } \ 48 } while (0) 49 #endif 50 51 #ifndef timercmp 52 /* does not work for >= and <= */ 53 # define timercmp(a, b, CMP) \ 54 (((a)->tv_sec == (b)->tv_sec) ? \ 55 ((a)->tv_usec CMP (b)->tv_usec) : \ 56 ((a)->tv_sec CMP (b)->tv_sec)) 57 #endif 58 /* endof timer* macros */ 59 60 #ifndef MIN 61 # define MIN(a,b) (((a)<(b))?(a):(b)) 62 #endif 63 64 #ifndef MAX 65 # define MAX(a,b) (((a)>(b))?(a):(b)) 66 #endif 67 68 #if defined(HAVE_PTRACE) || defined(PROC_MEM_FILE) || defined(HAVE_MACH_VM_READ) 69 # define HAVE_FPM_TRACE 1 70 #else 71 # define HAVE_FPM_TRACE 0 72 #endif 73 74 #if defined(HAVE_LQ_TCP_INFO) || defined(HAVE_LQ_SO_LISTENQ) 75 # define HAVE_FPM_LQ 1 76 #else 77 # define HAVE_FPM_LQ 0 78 #endif 79 80