about summary refs log tree commit diff
path: root/rt/aio_notify.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-25 10:30:35 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-25 11:48:25 +0200
commitd12506b2dbbeb259468e0f06e87a98174e69a743 (patch)
tree7dd428bde261bd9f75ab54c86696a8220f203ef9 /rt/aio_notify.c
parent97ed4749becdc20481688ee074e90507ca3501dd (diff)
downloadglibc-d12506b2dbbeb259468e0f06e87a98174e69a743.tar.gz
glibc-d12506b2dbbeb259468e0f06e87a98174e69a743.tar.xz
glibc-d12506b2dbbeb259468e0f06e87a98174e69a743.zip
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  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'rt/aio_notify.c')
-rw-r--r--rt/aio_notify.c21
1 files changed, 17 insertions, 4 deletions
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 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
-#include <pthread.h>
+#include <pthreadP.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <aio_misc.h>
 #include <signal.h>
 
+#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