This is an archive of the discontinued LLVM Phabricator instance.

Use correct function signature for strerror_r interceptor
ClosedPublic

Authored by fjricci on Feb 22 2017, 2:04 PM.

Details

Summary

There are two possible return values for strerror_r:

On OS X, the return value is always int.
On Linux, the return value can be either char * or int, depending
on the value of:
(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE

Because OS X interceptors require a matching function signature,
split out the two cases into separate interceptors, using the above
information to determine the correct signature for a given build.

Event Timeline

fjricci created this revision.Feb 22 2017, 2:04 PM

Ping - this is required for Darwin LSAN builds to be enabled by default.

vitalybuka accepted this revision.Mar 8 2017, 1:00 PM
This revision is now accepted and ready to land.Mar 8 2017, 1:00 PM
fjricci closed this revision.Mar 8 2017, 3:06 PM

Committed as r297315