Linux: Move mq_notify from librt to libc

The symbol was moved using scripts/move-symbol-to-libc.py.

An explicit call from fork into the mq_notify implementation replaces
the previous use of pthread_atfork.

Reviewed-by: Adhemerva Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer 2021-06-25 10:42:52 +02:00
parent f66d9abca7
commit 2da5f22fff
68 changed files with 101 additions and 68 deletions

View File

@ -15,6 +15,10 @@ hidden_proto (mq_setattr)
# if PTHREAD_IN_LIBC
libc_hidden_proto (mq_setattr)
/* Called from fork so that the new subprocess re-creates the
notification thread if necessary. */
void __mq_notify_fork_subprocess (void) attribute_hidden;
# endif
#include <struct___timespec64.h>

View File

@ -13,6 +13,9 @@ libc_hidden_proto (__pthread_barrier_init)
#endif
extern int __pthread_barrier_wait (pthread_barrier_t *__barrier)
__THROWNL __nonnull ((1));
#if PTHREAD_IN_LIBC
libc_hidden_proto (__pthread_barrier_wait)
#endif
/* This function is called to initialize the pthread library. */
extern void __pthread_initialize (void) __attribute__ ((weak));

View File

@ -30,7 +30,6 @@ routines = \
librt-routines = \
librt-compat \
mq_notify \
mq_open \
mq_receive \
mq_send \
@ -62,6 +61,7 @@ $(librt-routines-var) += \
lio_listio64 \
mq_close \
mq_getattr \
mq_notify \
mq_setattr \
tests := tst-shm tst-timer tst-timer2 \

View File

@ -28,6 +28,7 @@ libc {
%if PTHREAD_IN_LIBC
mq_close;
mq_getattr;
mq_notify;
mq_setattr;
%endif
}
@ -58,6 +59,7 @@ libc {
lio_listio64;
mq_close;
mq_getattr;
mq_notify;
mq_setattr;
%endif
shm_open;
@ -112,9 +114,9 @@ librt {
%if !PTHREAD_IN_LIBC
mq_close;
mq_getattr;
mq_notify;
mq_setattr;
%endif
mq_notify;
mq_open;
mq_receive;
mq_send;

View File

@ -22,6 +22,7 @@
#include <assert.h>
#include <ldsodefs.h>
#include <list.h>
#include <mqueue.h>
#include <pthreadP.h>
#include <sysdep.h>
@ -41,6 +42,8 @@ fork_system_setup_after_fork (void)
/* Initialize thread library locks. */
GL (dl_stack_cache_lock) = LLL_LOCK_INITIALIZER;
__default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
call_function_static_weak (__mq_notify_fork_subprocess);
}
/* In case of a fork() call the memory allocation in the child will be

View File

@ -1359,6 +1359,7 @@ GLIBC_2.17 mprobe F
GLIBC_2.17 mprotect F
GLIBC_2.17 mq_close F
GLIBC_2.17 mq_getattr F
GLIBC_2.17 mq_notify F
GLIBC_2.17 mq_setattr F
GLIBC_2.17 mrand48 F
GLIBC_2.17 mrand48_r F
@ -2404,6 +2405,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.17 __mq_open_2 F
GLIBC_2.17 mq_notify F
GLIBC_2.17 mq_open F
GLIBC_2.17 mq_receive F
GLIBC_2.17 mq_send F

View File

@ -2394,6 +2394,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2499,6 +2500,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -10,7 +10,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -1290,6 +1290,7 @@ GLIBC_2.32 mprobe F
GLIBC_2.32 mprotect F
GLIBC_2.32 mq_close F
GLIBC_2.32 mq_getattr F
GLIBC_2.32 mq_notify F
GLIBC_2.32 mq_setattr F
GLIBC_2.32 mrand48 F
GLIBC_2.32 mrand48_r F
@ -2163,6 +2164,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.32 __mq_open_2 F
GLIBC_2.32 mq_notify F
GLIBC_2.32 mq_open F
GLIBC_2.32 mq_receive F
GLIBC_2.32 mq_send F

View File

@ -315,6 +315,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F
@ -1731,6 +1732,7 @@ GLIBC_2.4 mprobe F
GLIBC_2.4 mprotect F
GLIBC_2.4 mq_close F
GLIBC_2.4 mq_getattr F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_setattr F
GLIBC_2.4 mrand48 F
GLIBC_2.4 mrand48_r F

View File

@ -2,7 +2,6 @@ GLIBC_2.34 __mq_timedreceive_time64 F
GLIBC_2.34 __mq_timedsend_time64 F
GLIBC_2.34 __timer_gettime64 F
GLIBC_2.34 __timer_settime64 F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_open F
GLIBC_2.4 mq_receive F
GLIBC_2.4 mq_send F

View File

@ -312,6 +312,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F
@ -1728,6 +1729,7 @@ GLIBC_2.4 mprobe F
GLIBC_2.4 mprotect F
GLIBC_2.4 mq_close F
GLIBC_2.4 mq_getattr F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_setattr F
GLIBC_2.4 mrand48 F
GLIBC_2.4 mrand48_r F

View File

@ -2,7 +2,6 @@ GLIBC_2.34 __mq_timedreceive_time64 F
GLIBC_2.34 __mq_timedsend_time64 F
GLIBC_2.34 __timer_gettime64 F
GLIBC_2.34 __timer_settime64 F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_open F
GLIBC_2.4 mq_receive F
GLIBC_2.4 mq_send F

View File

@ -1345,6 +1345,7 @@ GLIBC_2.29 mprobe F
GLIBC_2.29 mprotect F
GLIBC_2.29 mq_close F
GLIBC_2.29 mq_getattr F
GLIBC_2.29 mq_notify F
GLIBC_2.29 mq_setattr F
GLIBC_2.29 mrand48 F
GLIBC_2.29 mrand48_r F
@ -2424,6 +2425,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.29 __mq_open_2 F
GLIBC_2.29 mq_notify F
GLIBC_2.29 mq_open F
GLIBC_2.29 mq_receive F
GLIBC_2.29 mq_send F

View File

@ -2208,6 +2208,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2378,6 +2379,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2389,6 +2389,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2562,6 +2563,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2243,6 +2243,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2337,6 +2338,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -9,7 +9,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -316,6 +316,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F
@ -1715,6 +1716,7 @@ GLIBC_2.4 mprobe F
GLIBC_2.4 mprotect F
GLIBC_2.4 mq_close F
GLIBC_2.4 mq_getattr F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_setattr F
GLIBC_2.4 mrand48 F
GLIBC_2.4 mrand48_r F

View File

@ -2,7 +2,6 @@ GLIBC_2.34 __mq_timedreceive_time64 F
GLIBC_2.34 __mq_timedsend_time64 F
GLIBC_2.34 __timer_gettime64 F
GLIBC_2.34 __timer_settime64 F
GLIBC_2.4 mq_notify F
GLIBC_2.4 mq_open F
GLIBC_2.4 mq_receive F
GLIBC_2.4 mq_send F

View File

@ -2332,6 +2332,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2505,6 +2506,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -1361,6 +1361,7 @@ GLIBC_2.18 mprobe F
GLIBC_2.18 mprotect F
GLIBC_2.18 mq_close F
GLIBC_2.18 mq_getattr F
GLIBC_2.18 mq_notify F
GLIBC_2.18 mq_setattr F
GLIBC_2.18 mrand48 F
GLIBC_2.18 mrand48_r F
@ -2475,6 +2476,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.18 __mq_open_2 F
GLIBC_2.18 mq_notify F
GLIBC_2.18 mq_open F
GLIBC_2.18 mq_receive F
GLIBC_2.18 mq_send F

View File

@ -1361,6 +1361,7 @@ GLIBC_2.18 mprobe F
GLIBC_2.18 mprotect F
GLIBC_2.18 mq_close F
GLIBC_2.18 mq_getattr F
GLIBC_2.18 mq_notify F
GLIBC_2.18 mq_setattr F
GLIBC_2.18 mrand48 F
GLIBC_2.18 mrand48_r F
@ -2472,6 +2473,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.18 __mq_open_2 F
GLIBC_2.18 mq_notify F
GLIBC_2.18 mq_open F
GLIBC_2.18 mq_receive F
GLIBC_2.18 mq_send F

View File

@ -2300,6 +2300,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2470,6 +2471,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -3,7 +3,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2298,6 +2298,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2468,6 +2469,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -2306,6 +2306,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2476,6 +2477,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -3,7 +3,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2300,6 +2300,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2393,6 +2394,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -3,7 +3,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -29,7 +29,7 @@
#include <sys/socket.h>
#include <not-cancel.h>
#include <pthreadP.h>
#include <shlib-compat.h>
/* Defined in the kernel headers: */
#define NOTIFY_COOKIE_LEN 32 /* Length of the cookie used. */
@ -75,7 +75,7 @@ change_sigmask (int how, sigset_t *oss)
{
sigset_t ss;
sigfillset (&ss);
return pthread_sigmask (how, &ss, oss);
return __pthread_sigmask (how, &ss, oss);
}
@ -93,7 +93,7 @@ notification_function (void *arg)
(void) __pthread_barrier_wait (&notify_barrier);
/* Make the thread detached. */
(void) pthread_detach (pthread_self ());
__pthread_detach (__pthread_self ());
/* The parent thread has all signals blocked. This is probably a
bit surprising for this thread. So we unblock all of them. */
@ -125,9 +125,8 @@ helper_thread (void *arg)
/* Just create the thread as instructed. There is no way to
report a problem with creating a thread. */
pthread_t th;
if (__builtin_expect (pthread_create (&th, data.attr,
notification_function, &data)
== 0, 0))
if (__pthread_create (&th, data.attr, notification_function, &data)
== 0)
/* Since we passed a pointer to DATA to the new thread we have
to wait until it is done with it. */
(void) __pthread_barrier_wait (&notify_barrier);
@ -135,7 +134,7 @@ helper_thread (void *arg)
else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
{
/* The only state we keep is the copy of the thread attributes. */
pthread_attr_destroy (data.attr);
__pthread_attr_destroy (data.attr);
free (data.attr);
}
}
@ -143,8 +142,8 @@ helper_thread (void *arg)
}
static void
reset_once (void)
void
__mq_notify_fork_subprocess (void)
{
once = PTHREAD_ONCE_INIT;
}
@ -167,15 +166,14 @@ init_mq_netlink (void)
int err = 1;
/* Initialize the barrier. */
if (__builtin_expect (__pthread_barrier_init (&notify_barrier, NULL, 2) == 0,
0))
if (__pthread_barrier_init (&notify_barrier, NULL, 2) == 0)
{
/* Create the helper thread. */
pthread_attr_t attr;
(void) pthread_attr_init (&attr);
(void) pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
__pthread_attr_init (&attr);
__pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
/* We do not need much stack space, the bare minimum will be enough. */
(void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
__pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
/* Temporarily block all signals so that the newly created
thread inherits the mask. */
@ -183,29 +181,13 @@ init_mq_netlink (void)
int have_no_oss = change_sigmask (SIG_BLOCK, &oss);
pthread_t th;
err = pthread_create (&th, &attr, helper_thread, NULL);
err = __pthread_create (&th, &attr, helper_thread, NULL);
/* Reset the signal mask. */
if (!have_no_oss)
pthread_sigmask (SIG_SETMASK, &oss, NULL);
__pthread_sigmask (SIG_SETMASK, &oss, NULL);
(void) pthread_attr_destroy (&attr);
if (err == 0)
{
static int added_atfork;
if (added_atfork == 0
&& pthread_atfork (NULL, NULL, reset_once) != 0)
{
/* The child thread will call recv() which is a
cancellation point. */
(void) pthread_cancel (th);
err = 1;
}
else
added_atfork = 1;
}
__pthread_attr_destroy (&attr);
}
if (err != 0)
@ -219,7 +201,7 @@ init_mq_netlink (void)
/* Register notification upon message arrival to an empty message queue
MQDES. */
int
mq_notify (mqd_t mqdes, const struct sigevent *notification)
__mq_notify (mqd_t mqdes, const struct sigevent *notification)
{
/* Make sure the type is correctly defined. */
assert (sizeof (union notify_data) == NOTIFY_COOKIE_LEN);
@ -235,7 +217,7 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
response. */
/* Initialize only once. */
pthread_once (&once, init_mq_netlink);
__pthread_once (&once, init_mq_netlink);
/* If we cannot create the netlink socket we cannot provide
SIGEV_THREAD support. */
@ -280,9 +262,14 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
/* If it failed, free the allocated memory. */
if (retval != 0 && data.attr != NULL)
{
pthread_attr_destroy (data.attr);
__pthread_attr_destroy (data.attr);
free (data.attr);
}
return retval;
}
versioned_symbol (libc, __mq_notify, mq_notify, GLIBC_2_34);
libc_hidden_ver (__mq_notify, mq_notify)
#if OTHER_SHLIB_COMPAT (librt, GLIBC_2_3_4, GLIBC_2_34)
compat_symbol (librt, __mq_notify, mq_notify, GLIBC_2_3_4);
#endif

View File

@ -1404,6 +1404,7 @@ GLIBC_2.21 mprobe F
GLIBC_2.21 mprotect F
GLIBC_2.21 mq_close F
GLIBC_2.21 mq_getattr F
GLIBC_2.21 mq_notify F
GLIBC_2.21 mq_setattr F
GLIBC_2.21 mrand48 F
GLIBC_2.21 mrand48_r F
@ -2514,6 +2515,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.21 __mq_open_2 F
GLIBC_2.21 mq_notify F
GLIBC_2.21 mq_open F
GLIBC_2.21 mq_receive F
GLIBC_2.21 mq_send F

View File

@ -2346,6 +2346,7 @@ GLIBC_2.3.4 longjmp F
GLIBC_2.3.4 makecontext F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2532,6 +2533,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2379,6 +2379,7 @@ GLIBC_2.3.4 longjmp F
GLIBC_2.3.4 makecontext F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2565,6 +2566,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -2192,6 +2192,7 @@ GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 longjmp F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2301,6 +2302,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -8,7 +8,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -1447,6 +1447,7 @@ GLIBC_2.17 mprobe F
GLIBC_2.17 mprotect F
GLIBC_2.17 mq_close F
GLIBC_2.17 mq_getattr F
GLIBC_2.17 mq_notify F
GLIBC_2.17 mq_setattr F
GLIBC_2.17 mrand48 F
GLIBC_2.17 mrand48_r F
@ -2600,6 +2601,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.17 __mq_open_2 F
GLIBC_2.17 mq_notify F
GLIBC_2.17 mq_open F
GLIBC_2.17 mq_receive F
GLIBC_2.17 mq_send F

View File

@ -1292,6 +1292,7 @@ GLIBC_2.33 mprobe F
GLIBC_2.33 mprotect F
GLIBC_2.33 mq_close F
GLIBC_2.33 mq_getattr F
GLIBC_2.33 mq_notify F
GLIBC_2.33 mq_setattr F
GLIBC_2.33 mrand48 F
GLIBC_2.33 mrand48_r F
@ -2165,6 +2166,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.33 __mq_open_2 F
GLIBC_2.33 mq_notify F
GLIBC_2.33 mq_open F
GLIBC_2.33 mq_receive F
GLIBC_2.33 mq_send F

View File

@ -1342,6 +1342,7 @@ GLIBC_2.27 mprobe F
GLIBC_2.27 mprotect F
GLIBC_2.27 mq_close F
GLIBC_2.27 mq_getattr F
GLIBC_2.27 mq_notify F
GLIBC_2.27 mq_setattr F
GLIBC_2.27 mrand48 F
GLIBC_2.27 mrand48_r F
@ -2365,6 +2366,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.27 __mq_open_2 F
GLIBC_2.27 mq_notify F
GLIBC_2.27 mq_open F
GLIBC_2.27 mq_receive F
GLIBC_2.27 mq_send F

View File

@ -2345,6 +2345,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2530,6 +2531,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2233,6 +2233,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2338,6 +2339,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -8,7 +8,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2212,6 +2212,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2385,6 +2386,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2212,6 +2212,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2382,6 +2383,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -4,7 +4,6 @@ GLIBC_2.2 timer_delete F
GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2343,6 +2343,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2525,6 +2526,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -5,7 +5,6 @@ GLIBC_2.2 timer_getoverrun F
GLIBC_2.2 timer_gettime F
GLIBC_2.2 timer_settime F
GLIBC_2.3 __librt_version_placeholder F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2267,6 +2267,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2360,6 +2361,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -10,7 +10,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -2221,6 +2221,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
GLIBC_2.3.4 getsourcefilter F
GLIBC_2.3.4 mq_close F
GLIBC_2.3.4 mq_getattr F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_setattr F
GLIBC_2.3.4 pthread_attr_getaffinity_np F
GLIBC_2.3.4 pthread_attr_setaffinity_np F
@ -2316,6 +2317,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -8,7 +8,6 @@ GLIBC_2.3.3 timer_delete F
GLIBC_2.3.3 timer_getoverrun F
GLIBC_2.3.3 timer_gettime F
GLIBC_2.3.3 timer_settime F
GLIBC_2.3.4 mq_notify F
GLIBC_2.3.4 mq_open F
GLIBC_2.3.4 mq_receive F
GLIBC_2.3.4 mq_send F

View File

@ -1366,6 +1366,7 @@ GLIBC_2.16 mprobe F
GLIBC_2.16 mprotect F
GLIBC_2.16 mq_close F
GLIBC_2.16 mq_getattr F
GLIBC_2.16 mq_notify F
GLIBC_2.16 mq_setattr F
GLIBC_2.16 mrand48 F
GLIBC_2.16 mrand48_r F
@ -2419,6 +2420,7 @@ GLIBC_2.34 lio_listio F
GLIBC_2.34 lio_listio64 F
GLIBC_2.34 mq_close F
GLIBC_2.34 mq_getattr F
GLIBC_2.34 mq_notify F
GLIBC_2.34 mq_setattr F
GLIBC_2.34 mtx_destroy F
GLIBC_2.34 mtx_init F

View File

@ -1,5 +1,4 @@
GLIBC_2.16 __mq_open_2 F
GLIBC_2.16 mq_notify F
GLIBC_2.16 mq_open F
GLIBC_2.16 mq_receive F
GLIBC_2.16 mq_send F