Compat fix for HHVM on non-Linux OSs
authorOri Livneh <ori@wikimedia.org>
Wed, 23 Sep 2015 08:53:47 +0000 (01:53 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 23 Sep 2015 08:55:57 +0000 (01:55 -0700)
commit602a74af5d4d4da82e51cb174c2a37a02a7f34b8
tree657eb9c17f50b6cf2aa9501671d0bc17abc3efbb
parenta09d063de3af3f19da3ee3be579a727c816a4284
Compat fix for HHVM on non-Linux OSs

RUSAGE_THREAD is not POSIX; it's Linux-specific. HHVM now compiles on OS X,
and calling getrusage( 2 ) on OS X explodes with:

    exception : f_getrusage is not supported: RUSAGE_THREAD is not defined on
    this sytem [sic]

HHVM is being ported to Windows, too, where RUSAGE_THREAD is likewise missing.
So check that PHP_OS === 'Linux' before using it.

Change-Id: I6eac7d2bb4edfa1e697ae72f89299d0d5ac135f4
includes/profiler/ProfilerFunctions.php