Mercurial > hg > nginx-quic
comparison auto/unix @ 7222:81fae70d6cb8
Core: ngx_current_msec now uses monotonic time if available.
When clock_gettime(CLOCK_MONOTONIC) (or faster variants, _FAST on FreeBSD,
and _COARSE on Linux) is available, we now use it for ngx_current_msec.
This should improve handling of timers if system time changes (ticket #189).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 01 Mar 2018 20:25:50 +0300 |
parents | 057adb2a9d23 |
children | 04ebf29eaf5b |
comparison
equal
deleted
inserted
replaced
7221:43585e0e12a3 | 7222:81fae70d6cb8 |
---|---|
789 ngx_feature_libs= | 789 ngx_feature_libs= |
790 ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)" | 790 ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)" |
791 . auto/feature | 791 . auto/feature |
792 | 792 |
793 | 793 |
794 ngx_feature="clock_gettime(CLOCK_MONOTONIC)" | |
795 ngx_feature_name="NGX_HAVE_CLOCK_MONOTONIC" | |
796 ngx_feature_run=no | |
797 ngx_feature_incs="#include <time.h>" | |
798 ngx_feature_path= | |
799 ngx_feature_libs= | |
800 ngx_feature_test="struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts)" | |
801 . auto/feature | |
802 | |
803 | |
804 if [ $ngx_found = no ]; then | |
805 | |
806 # Linux before glibc 2.17, notably CentOS 6 | |
807 | |
808 ngx_feature="clock_gettime(CLOCK_MONOTONIC) in librt" | |
809 ngx_feature_libs="-lrt" | |
810 . auto/feature | |
811 | |
812 if [ $ngx_found = yes ]; then | |
813 CORE_LIBS="$CORE_LIBS -lrt" | |
814 fi | |
815 fi | |
816 | |
817 | |
794 ngx_feature="posix_memalign()" | 818 ngx_feature="posix_memalign()" |
795 ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN" | 819 ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN" |
796 ngx_feature_run=no | 820 ngx_feature_run=no |
797 ngx_feature_incs="#include <stdlib.h>" | 821 ngx_feature_incs="#include <stdlib.h>" |
798 ngx_feature_path= | 822 ngx_feature_path= |