#101 CRITICAL: ftime usage causes failure on newest OS X



**Please contact me at mmacaluso@wavecorp.com if you
would like more information on this. Anything that I
can do to expedite a 3.1.3 version, I would be happy to

On most BSD platforms, the function ftime has been
deprecated with the replacement being the gettimeofday
function. However, OS X has taken this one step
further by removing the symbol from the libcrypto.dylib
(aka, libcrypto.0.9.7.dylib) library. This change,
gotten from the most recent OS X security updates to
10.3 and 10.4, will cause either a runtime dynamic
library undefined symbol error or a compile link error.

Taking the deprecation at its word and switching to
using gettimeofday, we can avoid the above problems as
well as being able to remove the "-lcrypto" flag from
the make file.

As a suggestion, where necessary, switch over to using
gettimeofday instead of ftime and hide the time
retrieval in a new function. More specifically,
perform the following changes and that should suffice
for most (if not all) platforms:

1) in wrapper.c:
1a) add at line 436:
void wrapperGetCurrentTime(struct timeb *timeBuffer) {
#ifdef WIN32
struct timeval tv;
gettimeofday(&tv, NULL);
timeBuffer->time = (time_t) tv.tv_sec;
timeBuffer->millitm = (unsigned short) (tv.tv_usec /

1b) change all uses of ftime to wrapperGetCurrentTime.

2) in wrapper_unix.c:
2a) add at line 378:
extern void wrapperGetCurrentTime(struct timeb

2b) change all uses of ftime to wrapperGetCurrentTime.

3) in Makefile.macosx:
3a) Remove the "-lcrypto" link setting.


  • Michael Macaluso

    • priority: 5 --> 9
  • Leif Mortenson

    Leif Mortenson - 2005-10-13
    • assigned_to: nobody --> mortenson
    • status: open --> open-fixed
  • Leif Mortenson

    Leif Mortenson - 2005-10-13

    Logged In: YES

    This has been fixed for the 3.2.0 release and is in CVS. I
    am really overdue for a release but getting everything tied
    up and tested has been taking more time than I have lately.
    I will try to get it out as soon as possible, but I would
    suggest building from source for the time being.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks