- User Since
- Mar 27 2017, 4:47 PM (121 w, 1 d)
Dec 7 2013
Even if that function is never called on Android, it will need to be #ifdefed out
in order for that code to build for Android. Right now, linking fails because it
can't find the symbol pthread_atfork.
Dec 6 2013
Its also not in any headers in the NDK:
$ grep atfork /opt/android-ndk/platforms/android-*/arch-arm/usr/include/*.h
$ grep atfork /opt/android-ndk/platforms/android-*/arch-arm/usr/include/*/*.h
Bad news, though that .c/.cpp file exists, it does not seem to get built into
Android. I have tried building against android-14, which is after that file was
introduces, and no luck. I also tried looking for it in the libs, and its not
in the .so or .a libs. Running this gives me nothing:
$ strings /opt/android-ndk/platforms/android-*/arch-arm/usr/lib/* | grep atfork
Dec 5 2013
we've decided to suspend support for older versions on Android, so we can leave
this as is for now, any maybe forever. We want to support older versions, but
its more work than we can handle. Patches are welcome though, if anyone wants
to add back support for Android versions old than android-14/4.0/Ice Cream Sandwich.
It looks like pthread_atfork() was not added to bionic libc until after
android-10/v2.3.6/Gingerbread. That excludes 1/4 of current Google Android
users, and probably more of unoffical Android users. To target older
versions of Android, you either have to include pthread-atfork.c or the newer
[pthread_atfork.cpp] in your project, or not use pthread_atfork() at all.
We might be able to manage including pthread-atfork.c, but it could be ugly.