pike.git / src / pike_rusage.h

version» Context lines:

pike.git/src/pike_rusage.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      #ifndef PIKE_RUSAGE_H   #define PIKE_RUSAGE_H      #include "global.h" -  - #ifdef HAVE_UNISTD_H - #include <unistd.h> - #endif - #ifdef HAVE_TIME_H +    #include <time.h> - #endif +     - #if defined (_POSIX_TIMERS) + #ifdef _POSIX_TIMERS   #if _POSIX_TIMERS > 0      #ifdef _POSIX_THREAD_CPUTIME   # if _POSIX_THREAD_CPUTIME != -1   # if _POSIX_THREAD_CPUTIME != 0   /* Know it to be available at compile time. */   # define HAVE_POSIX_THREAD_GCT   # else   /* Might be available at run time - have to check with sysconf(3). */   # endif   # define MIGHT_HAVE_POSIX_THREAD_GCT   # endif - #endif + #endif /* _POSIX_THREAD_CPUTIME */      #ifdef _POSIX_CPUTIME   # if _POSIX_CPUTIME != -1   # if _POSIX_CPUTIME != 0   # define HAVE_POSIX_PROCESS_GCT   # endif   # define MIGHT_HAVE_POSIX_PROCESS_GCT   # endif - #endif + #endif /* _POSIX_CPUTIME */      #ifdef _POSIX_MONOTONIC_CLOCK   # if _POSIX_MONOTONIC_CLOCK != -1   # if _POSIX_MONOTONIC_CLOCK != 0   # define HAVE_POSIX_MONOTONIC_GRT   # endif   # define MIGHT_HAVE_POSIX_MONOTONIC_GRT   # endif - #endif + #endif /* _POSIX_MONOTONIC_CLOCK */      /* The POSIX CLOCK_REALTIME clock is guaranteed to exist if    * _POSIX_TIMERS exist. */   #define HAVE_POSIX_REALTIME_GRT   #define MIGHT_HAVE_POSIX_REALTIME_GRT      #endif /* _POSIX_TIMERS > 0 */   #endif /* _POSIX_TIMERS */      #ifdef CONFIGURE_TEST_FALLBACK_GCT
pike.git/src/pike_rusage.h:153:      /* Prototypes begin here */   typedef long pike_rusage_t[29];   PMOD_EXPORT int pike_get_rusage(pike_rusage_t rusage_values);   long *low_rusage(void);      /* get_cpu_time returns the consumed cpu time (both in kernel and user    * space, if applicable), or -1 if it couldn't be read. Note that many    * systems have fairly poor resolution. gettimeofday can therefore be    * a better choice to measure small time intervals. */ - #ifdef INT64 +    /* The time is returned in nanoseconds. */   typedef INT64 cpu_time_t;   #define LONG_CPU_TIME   #define CPU_TIME_TICKS_LOW /* per second */ (1000000000L)   #define CPU_TIME_UNIT "ns"   #define PRINT_CPU_TIME PRINTINT64 "d" - #else - /* The time is returned in milliseconds. (Note that the value will -  * wrap after about 49 days.) */ - typedef unsigned long cpu_time_t; - #define CPU_TIME_TICKS_LOW /* per second */ 1000 - #define CPU_TIME_UNIT "ms" - #define PRINT_CPU_TIME "lu" - #endif +    #define CPU_TIME_TICKS /* per second */ ((cpu_time_t)CPU_TIME_TICKS_LOW)      #ifdef GCT_RUNTIME_CHOICE   #ifndef cpu_time_is_thread_local   PMOD_EXPORT extern int cpu_time_is_thread_local;   #endif   PMOD_EXPORT extern const char *get_cpu_time_impl;   PMOD_EXPORT extern cpu_time_t (*get_cpu_time) (void);   PMOD_EXPORT extern cpu_time_t (*get_cpu_time_res) (void);   #else