This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [Patch] timemodule: Complete Autoconf bits for clock_*() functions: make clock_getres() and clock_settime() optional
Type: Stage: resolved
Components: Extension Modules Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: EdSchouten, python-dev, vstinner
Priority: normal Keywords:

Created on 2016-09-11 18:31 by EdSchouten, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-clock_settime EdSchouten, 2016-09-11 18:31 Tiny cleanup fixes for timemodule.c review
Messages (3)
msg275827 - (view) Author: Ed Schouten (EdSchouten) * Date: 2016-09-11 18:31
Our Autoconf bits already test for the presence of the POSIX 2008 clock_gettime() and clock_getres() functions, which is nice. Still, I'd like to make two improvements there:

1. In timemodule.c, properly guard the use of clock_getres() bits with HAVE_CLOCK_GETRES instead of using HAVE_CLOCK_GETTIME. There don't seem to be any shared functions/structures/etc., so we can safely decouple them.

2. For consistency, also add Autoconf bits for clock_settime(). In timemodule.c, use HAVE_CLOCK_SETTIME as a guard.

The reason why I'm sending in this patch is because CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) does provide clock_gettime() and clock_getres(), but not clock_settime(). The reason for this is that CloudABI is meant for running unprivileged/sandboxed code. There is no need to provide an API for adjusting system-wide clocks.

Do note that this patch does not contain any changes to Autoconf generated files.
msg276032 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-12 12:51
LGTM, but I wait until Python 3.6 beta 1 is tagged to push this change.
msg276384 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-14 05:55
New changeset 0ea088671bc2 by Benjamin Peterson in branch '3.6':
more granular configure checks for clock_* functions (closes #28081)
https://hg.python.org/cpython/rev/0ea088671bc2

New changeset 3ce29b2452f0 by Benjamin Peterson in branch 'default':
merge 3.6 (#28081)
https://hg.python.org/cpython/rev/3ce29b2452f0
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72268
2016-09-14 05:55:28python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg276384

resolution: fixed
stage: resolved
2016-09-12 12:51:16vstinnersetmessages: + msg276032
2016-09-11 23:27:35berker.peksagsetnosy: + vstinner
2016-09-11 18:31:09EdSchoutencreate