gh-108277: Add os.timerfd_create() function (#108382)

Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Masaru Tsuchiyama 2023-10-08 02:33:22 +09:00 committed by GitHub
parent 64f158e7b0
commit de2a4036cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1527 additions and 5 deletions

50
configure generated vendored
View file

@ -10709,6 +10709,12 @@ if test "x$ac_cv_header_sys_times_h" = xyes
then :
printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_timerfd_h" = xyes
then :
printf "%s\n" "#define HAVE_SYS_TIMERFD_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_types_h" = xyes
@ -18781,6 +18787,50 @@ fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timerfd_create" >&5
printf %s "checking for timerfd_create... " >&6; }
if test ${ac_cv_func_timerfd_create+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_SYS_TIMERFD_H
#include <sys/timerfd.h>
#endif
int
main (void)
{
void *x=timerfd_create
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_func_timerfd_create=yes
else $as_nop
ac_cv_func_timerfd_create=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_timerfd_create" >&5
printf "%s\n" "$ac_cv_func_timerfd_create" >&6; }
if test "x$ac_cv_func_timerfd_create" = xyes
then :
printf "%s\n" "#define HAVE_TIMERFD_CREATE 1" >>confdefs.h
fi
# On some systems (eg. FreeBSD 5), we would find a definition of the
# functions ctermid_r, setgroups in the library, but no prototype
# (e.g. because we use _XOPEN_SOURCE). See whether we can take their