[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Resolve conflicts for functions introduced in Android API level 30
From: |
Bruno Haible |
Subject: |
Resolve conflicts for functions introduced in Android API level 30 |
Date: |
Thu, 25 Jan 2024 20:28:08 +0100 |
Po Lu wrote:
> this new release of the Android NDK
Thanks for notifying us about it. In the NDK r26, I see new functions
were added at the Android levels 30, 31, 32, 33, 34.
At level 30 the added functions are:
<pthread.h>
pthread_cond_clockwait
pthread_mutex_clocklock
pthread_rwlock_clockrdlock
pthread_rwlock_clockwrlock
<threads.h>
call_once
cnd_broadcast
cnd_destroy
cnd_init
cnd_signal
cnd_timedwait
cnd_wait
mtx_destroy
mtx_init
mtx_lock
mtx_timedlock
mtx_trylock
mtx_unlock
thrd_create
thrd_current
thrd_detach
thrd_equal
thrd_exit
thrd_join
thrd_sleep
thrd_yield
tss_create
tss_delete
tss_get
tss_set
<stdio.h>
renameat2
<sys/stat.h>
statx
<sys/mman.h>
mlock2
memfd_create
<sys/semaphore.h>
sem_clockwait
The added functions in <threads.h> need code changes in Gnulib. Namely, when
a user compiles a program with an NDK version < 21, <threads.h> and all the
threads.h functions are missing, and the Gnulib replacements need to have
function names prefixed with rpl_ (to avoid problems when the program is run
on a machine that has these functions defined in libc).
When the NDK version is ≥ 21 but the Android API level is < 30, these functions
are defined as inline functions in the Android libc header files, and Gnulib
does not activate its replacements.
For the other ones, only documentation tweaks are needed.
2024-01-25 Bruno Haible <bruno@clisp.org>
Resolve conflicts for functions introduced in Android API level 30.
* doc/glibc-functions/memfd_create.texi: Mention the Android API levels.
* doc/glibc-functions/mlock2.texi: Likewise.
* doc/glibc-functions/pthread_cond_clockwait.texi: Likewise.
* doc/glibc-functions/pthread_mutex_clocklock.texi: Likewise.
* doc/glibc-functions/pthread_rwlock_clockrdlock.texi: Likewise.
* doc/glibc-functions/pthread_rwlock_clockwrlock.texi: Likewise.
* doc/glibc-functions/renameat2.texi: Likewise.
* doc/glibc-functions/sem_clockwait.texi: Likewise.
* doc/glibc-functions/statx.texi: Likewise.
* lib/threads.in.h (thrd_sleep): Consider REPLACE_THRD_SLEEP.
(thrd_yield): Consider REPLACE_THRD_YIELD.
(mtx_init): Consider REPLACE_MTX_INIT.
(mtx_lock): Consider REPLACE_MTX_LOCK.
(mtx_trylock): Consider REPLACE_MTX_TRYLOCK.
(mtx_timedlock): Consider REPLACE_MTX_TIMEDLOCK.
(mtx_unlock): Consider REPLACE_MTX_UNLOCK.
(mtx_destroy): Consider REPLACE_MTX_DESTROY.
(call_once): Consider REPLACE_CALL_ONCE. Fix warning message.
(cnd_init): Consider REPLACE_CND_INIT.
(cnd_wait): Consider REPLACE_CND_WAIT.
(cnd_timedwait): Consider REPLACE_CND_TIMEDWAIT.
(cnd_signal): Consider REPLACE_CND_SIGNAL.
(cnd_broadcast): Consider REPLACE_CND_BROADCAST.
(cnd_destroy): Consider REPLACE_CND_DESTROY.
(tss_create): Consider REPLACE_TSS_CREATE.
(tss_set): Consider REPLACE_TSS_SET.
(tss_get): Consider REPLACE_TSS_GET.
(tss_delete): Consider REPLACE_TSS_DELETE.
* m4/threads_h.m4 (gl_THREADS_H_DEFAULTS): Initialize REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* modules/threads-h (Makefile.am): Substitute REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* m4/thrd.m4 (gl_FUNC_THRD_CREATE): New macro.
* modules/thrd (configure.ac): Invoke gl_FUNC_THRD_CREATE.
* m4/call_once.m4: New file.
* modules/call_once (Files): Add m4/call_once.m4.
(configure.ac): Invoke gl_FUNC_CALL_ONCE. Consider REPLACE_CALL_ONCE.
* m4/cnd.m4: New file.
* modules/cnd (Files): Add m4/cnd.m4.
(configure.ac): Invoke gl_FUNC_CND_INIT. Consider REPLACE_CND_INIT.
* m4/mtx.m4: New file.
* modules/mtx (Files): Add m4/mtx.m4.
(configure.ac): Invoke gl_FUNC_MTX_INIT. Consider REPLACE_MTX_INIT.
* m4/tss.m4: New file.
* modules/tss (Files): Add m4/tss.m4.
(configure.ac): Invoke gl_FUNC_TSS_CREATE. Consider REPLACE_TSS_CREATE.
* doc/posix-functions/call_once.texi: Mention the Android API levels.
* doc/posix-functions/cnd_broadcast.texi: Likewise.
* doc/posix-functions/cnd_destroy.texi: Likewise.
* doc/posix-functions/cnd_init.texi: Likewise.
* doc/posix-functions/cnd_signal.texi: Likewise.
* doc/posix-functions/cnd_timedwait.texi: Likewise.
* doc/posix-functions/cnd_wait.texi: Likewise.
* doc/posix-functions/mtx_destroy.texi: Likewise.
* doc/posix-functions/mtx_init.texi: Likewise.
* doc/posix-functions/mtx_lock.texi: Likewise.
* doc/posix-functions/mtx_timedlock.texi: Likewise.
* doc/posix-functions/mtx_trylock.texi: Likewise.
* doc/posix-functions/mtx_unlock.texi: Likewise.
* doc/posix-functions/thrd_create.texi: Likewise.
* doc/posix-functions/thrd_current.texi: Likewise.
* doc/posix-functions/thrd_detach.texi: Likewise.
* doc/posix-functions/thrd_equal.texi: Likewise.
* doc/posix-functions/thrd_exit.texi: Likewise.
* doc/posix-functions/thrd_join.texi: Likewise.
* doc/posix-functions/thrd_sleep.texi: Likewise.
* doc/posix-functions/thrd_yield.texi: Likewise.
* doc/posix-functions/tss_create.texi: Likewise.
* doc/posix-functions/tss_delete.texi: Likewise.
* doc/posix-functions/tss_get.texi: Likewise.
* doc/posix-functions/tss_set.texi: Likewise.
0001-Resolve-conflicts-for-functions-introduced-in-Androi.patch
Description: Text Data
0002-Resolve-conflicts-for-functions-introduced-in-Androi.patch
Description: Text Data
- Resolve conflicts for functions introduced in Android API level 30,
Bruno Haible <=