mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 15:04:10 +01:00
ircd::ctx::posix: Improve pthread version resolution for dlopen.
This commit is contained in:
parent
65322352b0
commit
5a6cd51530
1 changed files with 11 additions and 2 deletions
|
@ -75,6 +75,14 @@ ircd::ctx::posix::ctxs;
|
|||
// pthread supplement
|
||||
//
|
||||
|
||||
static const char *const
|
||||
ircd_pthread_paths[]
|
||||
{
|
||||
"libpthread.so.0",
|
||||
"libpthread.so",
|
||||
nullptr
|
||||
};
|
||||
|
||||
IRCD_WRAP(pthread_create, "__wrap_pthread_create",
|
||||
(
|
||||
pthread_t *const thread,
|
||||
|
@ -97,10 +105,11 @@ IRCD_WRAP(pthread_create, "__wrap_pthread_create",
|
|||
mutex
|
||||
};
|
||||
|
||||
if(!ircd::ctx::posix::real_pthread)
|
||||
auto p(ircd_pthread_paths[0]);
|
||||
while(p && !ircd::ctx::posix::real_pthread)
|
||||
ircd::ctx::posix::real_pthread = //.reset
|
||||
(
|
||||
dlopen("libpthread.so", RTLD_LOCAL | RTLD_LAZY)
|
||||
dlopen(p++, RTLD_LOCAL | RTLD_LAZY)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue