-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clock_gettime
is not used on Android, even though available (1.6.0+)
#1866
Labels
Comments
Possible solution: |
hungrycat
added a commit
to hungrycat/nng
that referenced
this issue
Sep 5, 2024
hungrycat
added a commit
to hungrycat/nng
that referenced
this issue
Sep 5, 2024
hungrycat
added a commit
to hungrycat/nng
that referenced
this issue
Sep 5, 2024
On Android's bionic implemementation of the system libraries, clock_gettime is available in libc.
hungrycat
added a commit
to hungrycat/nng
that referenced
this issue
Sep 5, 2024
On Android's bionic implementation of the system libraries, clock_gettime is available in libc.
A better solution IMO is to look first in libc, and only look in librt if we didn't find it in libc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Android has its own implementation of the system libraries: https://android.googlesource.com/platform/bionic.
clock_gettime
is made available inlibc
, not inlibrt
like on some other POSIX platforms. Yet, the check in the build system assumesclock_gettime
is inlibrt
:From
src/platform/posix/CMakeLists.txt
:As a consequence, on Android
NNG_HAVE_CLOCK_GETTIME
is never set, and fallback tonni_clock
is used instead ofclock_gettime
. As documented in the file, this severely hinders stability of nng on that platformTo Reproduce
Build for Android, assert in
posix_clock.c
on which implementation is used. Expectation:clock_gettime
.Environment Details
The text was updated successfully, but these errors were encountered: