Make detail/Futex.cpp bionic-safe
Summary: The headers that the Android NDK exports are all sorts of screwed up. In particular, they expose a subset of the `futex.h`, so, even though the kernel supports newer options, we can't reference them from the NDK headers. This diff ensures Futex.cpp redefines all the things it uses, if the headers are lacking. It also transitions away from `SYS_` to `__NR_` which is apparently the newer convention. Lastly, the duration usage is made explicitly `time_t`-safe for use on 32-bit platforms where `time_t` is `long int` but `std::chrono:seconds` is stored as `long long int`. Test Plan: Existing tests, sample app compiled and ran cleanly on Android as well (tests not verified on Android due to folly largely being unported to Android yet). Reviewed By: ngbronson@fb.com Subscribers: folly-diffs@, yfeldblum, chalfant FB internal diff: D2069306 Signature: t1:2069306:1431721711:36c77b1afe8dd9259c1050f11a87511dcf7dd25f
Showing
Please register or sign in to comment