summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorLivius <egyszeregy@freemail.hu>2021-09-13 12:37:38 (GMT)
committerGitHub <noreply@github.com>2021-09-13 12:37:38 (GMT)
commit85a4748118c3793be7047ecbcbfc79dd07cb2a75 (patch)
tree8faca8b6e772af6312db9daa26f4d89b1e29a3bd /configure
parent3e19409d6443c66a6a7d62f58b2bb4e8330e56c4 (diff)
downloadcpython-85a4748118c3793be7047ecbcbfc79dd07cb2a75.zip
cpython-85a4748118c3793be7047ecbcbfc79dd07cb2a75.tar.gz
cpython-85a4748118c3793be7047ecbcbfc79dd07cb2a75.tar.bz2
bpo-21302: Add clock_nanosleep() implementation for time.sleep() (GH-28111)
In Unix operating systems, time.sleep() now uses the clock_nanosleep() function, if available, which allows to sleep for an interval specified with nanosecond precision. Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure58
1 files changed, 58 insertions, 0 deletions
diff --git a/configure b/configure
index 4f12972..2e3c9ba 100755
--- a/configure
+++ b/configure
@@ -13252,6 +13252,64 @@ fi
done
+for ac_func in clock_nanosleep
+do :
+ ac_fn_c_check_func "$LINENO" "clock_nanosleep" "ac_cv_func_clock_nanosleep"
+if test "x$ac_cv_func_clock_nanosleep" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOCK_NANOSLEEP 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_nanosleep in -lrt" >&5
+$as_echo_n "checking for clock_nanosleep in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_nanosleep+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_nanosleep ();
+int
+main ()
+{
+return clock_nanosleep ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_nanosleep=yes
+else
+ ac_cv_lib_rt_clock_nanosleep=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_nanosleep" >&5
+$as_echo "$ac_cv_lib_rt_clock_nanosleep" >&6; }
+if test "x$ac_cv_lib_rt_clock_nanosleep" = xyes; then :
+
+ $as_echo "#define HAVE_CLOCK_NANOSLEEP 1" >>confdefs.h
+
+
+fi
+
+
+fi
+done
+
+
for ac_func in clock_getres
do :
ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres"