[pypy-issue] [issue1640] Posix 2001 ftime() is deprecated

Tobias Oberstein tracker at bugs.pypy.org
Sun Nov 17 19:24:03 CET 2013

New submission from Tobias Oberstein <tobias.oberstein at gmail.com>:

The ftime() function which is declared in <sys/timeb.h> which is only included
in rpython/rtyper/module/ll_time.py is deprecated:


The inclusion of the respective header produces lots of warnings on
FreeBSD/Clang and clutters the log.

The Linux man page suggests:

"This function is obsolete. Don't use it. If the time in seconds suffices,
time(2) can be used; gettimeofday(2) gives microseconds; clock_gettime(2) gives
nanoseconds but is not as widely available."

clock_gettime is available on both Linux and FreeBSD and provides
best-resolution time:


However, it's not there on OSX:


So we could adjust ll_time.py to use clock_gettime() instead of ftime() on
Linux/FreeBSD and do a workaround for OSX. Not sure if that would be acceptable ..

messages: 6350
nosy: oberstet, pypy-issue
priority: bug
status: unread
title: Posix 2001 ftime() is deprecated

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list