aboutsummaryrefslogtreecommitdiff
path: root/rt/aio_cancel.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-25 10:30:36 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-25 11:48:46 +0200
commit3df6dcc5c75b40d0ac0a9d22967da0a5a2b8df5c (patch)
tree7d411f73feedaca24ae047dca2f4892c412e246d /rt/aio_cancel.c
parentd12506b2dbbeb259468e0f06e87a98174e69a743 (diff)
downloadglibc-3df6dcc5c75b40d0ac0a9d22967da0a5a2b8df5c.tar
glibc-3df6dcc5c75b40d0ac0a9d22967da0a5a2b8df5c.tar.gz
glibc-3df6dcc5c75b40d0ac0a9d22967da0a5a2b8df5c.tar.bz2
glibc-3df6dcc5c75b40d0ac0a9d22967da0a5a2b8df5c.zip
Linux: Move aio_cancel, aio_cancel64 into libc
The symbols were moved using scripts/move-symbol-to-libc.py. A version placeholder symbol is needed on alpha and sparc because of the additional symbols formerly at version GLIBC_2.3. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>:
Diffstat (limited to 'rt/aio_cancel.c')
-rw-r--r--rt/aio_cancel.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/rt/aio_cancel.c b/rt/aio_cancel.c
index 63fd88f36c..5934205199 100644
--- a/rt/aio_cancel.c
+++ b/rt/aio_cancel.c
@@ -35,23 +35,24 @@
#include <fcntl.h>
#include <aio_misc.h>
+#include <pthreadP.h>
int
-aio_cancel (int fildes, struct aiocb *aiocbp)
+__aio_cancel (int fildes, struct aiocb *aiocbp)
{
struct requestlist *req = NULL;
int result = AIO_ALLDONE;
/* If fildes is invalid, error. */
- if (fcntl (fildes, F_GETFL) < 0)
+ if (__fcntl (fildes, F_GETFL) < 0)
{
__set_errno (EBADF);
return -1;
}
/* Request the mutex. */
- pthread_mutex_lock (&__aio_requests_mutex);
+ __pthread_mutex_lock (&__aio_requests_mutex);
/* We are asked to cancel a specific AIO request. */
if (aiocbp != NULL)
@@ -60,7 +61,7 @@ aio_cancel (int fildes, struct aiocb *aiocbp)
to look for the request block. */
if (aiocbp->aio_fildes != fildes)
{
- pthread_mutex_unlock (&__aio_requests_mutex);
+ __pthread_mutex_unlock (&__aio_requests_mutex);
__set_errno (EINVAL);
return -1;
}
@@ -73,7 +74,7 @@ aio_cancel (int fildes, struct aiocb *aiocbp)
if (req == NULL)
{
not_found:
- pthread_mutex_unlock (&__aio_requests_mutex);
+ __pthread_mutex_unlock (&__aio_requests_mutex);
__set_errno (EINVAL);
return -1;
}
@@ -147,11 +148,20 @@ aio_cancel (int fildes, struct aiocb *aiocbp)
}
/* Release the mutex. */
- pthread_mutex_unlock (&__aio_requests_mutex);
+ __pthread_mutex_unlock (&__aio_requests_mutex);
return result;
}
-
-#ifndef aio_cancel
-weak_alias (aio_cancel, aio_cancel64)
+#if PTHREAD_IN_LIBC
+# ifndef __aio_cancel
+versioned_symbol (libc, __aio_cancel, aio_cancel, GLIBC_2_34);
+versioned_symbol (libc, __aio_cancel, aio_cancel64, GLIBC_2_34);
+# if OTHER_SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_34)
+compat_symbol (librt, __aio_cancel, aio_cancel, GLIBC_2_1);
+compat_symbol (librt, __aio_cancel, aio_cancel64, GLIBC_2_1);
+# endif
+# endif /* __aio_cancel */
+#else /* !PTHREAD_IN_LIBC */
+strong_alias (__aio_cancel, aio_cancel)
+weak_alias (__aio_cancel, aio_cancel64)
#endif