X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Faio%2Flio_listio.c;h=0799c15d8b16f362eb3f5d5b813c23f124c214a2;hb=34952fe5de44a833370cbe87b63fb8eec61466d7;hp=61d7f20ef06cfab2f932a10b365412b924c216d3;hpb=b20760c02318fa6da228587c401a8b2bb22a1aab;p=musl diff --git a/src/aio/lio_listio.c b/src/aio/lio_listio.c index 61d7f20e..0799c15d 100644 --- a/src/aio/lio_listio.c +++ b/src/aio/lio_listio.c @@ -3,7 +3,6 @@ #include #include #include "pthread_impl.h" -#include "libc.h" struct lio_state { struct sigevent *sev; @@ -44,7 +43,7 @@ static void notify_signal(struct sigevent *sev) .si_signo = sev->sigev_signo, .si_value = sev->sigev_value, .si_code = SI_ASYNCIO, - .si_pid = __pthread_self()->pid, + .si_pid = getpid(), .si_uid = getuid() }; __syscall(SYS_rt_sigqueueinfo, si.si_pid, si.si_signo, &si); @@ -114,7 +113,7 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st if (st) { pthread_attr_t a; - sigset_t set; + sigset_t set, set_old; pthread_t td; if (sev->sigev_notify == SIGEV_THREAD) { @@ -129,15 +128,16 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st } pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED); sigfillset(&set); - pthread_sigmask(SIG_BLOCK, &set, &set); + pthread_sigmask(SIG_BLOCK, &set, &set_old); if (pthread_create(&td, &a, wait_thread, st)) { free(st); errno = EAGAIN; return -1; } - pthread_sigmask(SIG_SETMASK, &set, 0); + pthread_sigmask(SIG_SETMASK, &set_old, 0); } return 0; } +weak_alias(lio_listio, lio_listio64);