From d12506b2dbbeb259468e0f06e87a98174e69a743 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 25 Jun 2021 10:30:35 +0200 Subject: Linux: Move aio_init from librt into libc This commit also moves the aio_misc and aio_sigquue helper, so GLIBC_PRIVATE exports need to be added. The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- rt/aio_notify.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'rt/aio_notify.c') diff --git a/rt/aio_notify.c b/rt/aio_notify.c index a8d61503d8..432000e34b 100644 --- a/rt/aio_notify.c +++ b/rt/aio_notify.c @@ -18,12 +18,17 @@ . */ #include -#include +#include #include #include #include #include +#if !PTHREAD_IN_LIBC +# define __pthread_attr_init pthread_attr_init +# define __pthread_attr_setdetachstate pthread_attr_setdetachstate +#endif + #ifndef aio_start_notify_thread # define aio_start_notify_thread() do { } while (0) #endif @@ -62,8 +67,8 @@ __aio_notify_only (struct sigevent *sigev) pattr = (pthread_attr_t *) sigev->sigev_notify_attributes; if (pattr == NULL) { - pthread_attr_init (&attr); - pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + __pthread_attr_init (&attr); + __pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); pattr = &attr; } @@ -81,7 +86,7 @@ __aio_notify_only (struct sigevent *sigev) { nf->func = sigev->sigev_notify_function; nf->value = sigev->sigev_value; - if (pthread_create (&tid, pattr, notify_func_wrapper, nf) < 0) + if (__pthread_create (&tid, pattr, notify_func_wrapper, nf) < 0) { free (nf); result = -1; @@ -155,3 +160,11 @@ __aio_notify (struct requestlist *req) waitlist = next; } } + +#if PTHREAD_IN_LIBC +libc_hidden_def (__aio_notify) +libc_hidden_def (__aio_notify_only) +#else +librt_hidden_def (__aio_notify) +librt_hidden_def (__aio_notify_only) +#endif -- cgit v1.2.3