Function time_nanosleep() is undefined on OS X

Bug #60019 Function time_nanosleep() is undefined on OS X
Submitted: 2011-10-08 23:45 UTC Modified: 2011-10-14 12:43 UTC
From: php-bugs-2011 at ryandesign dot com Assigned: iliaa (profile)
Status: Closed Package: *Compile Issues
PHP Version: 5.3.8 OS: OS X 10.6.8
Private report: No CVE-ID: None

 [2011-10-08 23:45 UTC] php-bugs-2011 at ryandesign dot com

Description:
------------
Between PHP 5.3.3 and 5.3.4 the detection of the C nanosleep function
got broken on OS X, such that the time_nanosleep PHP function is no
longer available.

This problem was previously reported on Stack Overflow:

http://stackoverflow.com/questions/7503250

And to the MacPorts project:

https://trac.macports.org/ticket/31530

The fix for PHP bug 50345 seems to be the culprit. I fixed it in
MacPorts by reverting the change that resolved that bug (this is
what's in the attached patch), but this probably re-opens bug 50345.

PHP is looking for the nanosleep C function in the "rt" library, but 
there is no such library on Mac OS X, leading to this error in the
config.log:

ld: library not found for -lrt

Thus the test for existence of the nanosleep C function fails, and
therefore PHP gets built without the time_nanosleep PHP function.


Test script:
---------------
php -r 'echo (int)function_exists("time_nanosleep")."\n";'


Expected result:
----------------
1

Actual result:
--------------
0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-10-14 12:43 UTC] iliaa@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa