Commit c9db92fcc1c512b9e0e9928c0f2ac7a74b9cf384

Authored by blueswir1
1 parent 63c75dcd

Use kill instead of sigqueue: re-enables AIO on OpenBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6360 c046a42c-6fe2-441c-8c8c-71466251a162
block-raw-posix.c
... ... @@ -579,8 +579,7 @@ static RawAIOCB *raw_aio_setup(BlockDriverState *bs,
579 579 if (!acb)
580 580 return NULL;
581 581 acb->aiocb.aio_fildes = s->fd;
582   - acb->aiocb.aio_sigevent.sigev_signo = SIGUSR2;
583   - acb->aiocb.aio_sigevent.sigev_notify = SIGEV_SIGNAL;
  582 + acb->aiocb.sigev_signo = SIGUSR2;
584 583 acb->aiocb.aio_buf = buf;
585 584 if (nb_sectors < 0)
586 585 acb->aiocb.aio_nbytes = -nb_sectors;
... ...
configure
... ... @@ -1005,9 +1005,7 @@ if test &quot;$aio&quot; = &quot;yes&quot; ; then
1005 1005 aio=no
1006 1006 cat > $TMPC << EOF
1007 1007 #include <pthread.h>
1008   -#include <signal.h>
1009   -int main(void) { struct sigevent s; pthread_mutex_t lock;
1010   - return sigqueue(0, 0, s.sigev_value); }
  1008 +int main(void) { pthread_mutex_t lock; return 0; }
1011 1009 EOF
1012 1010 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1013 1011 aio=yes
... ...
posix-aio-compat.c
... ... @@ -94,9 +94,7 @@ static void *aio_thread(void *unused)
94 94 idle_threads++;
95 95 pthread_mutex_unlock(&lock);
96 96  
97   - sigqueue(getpid(),
98   - aiocb->aio_sigevent.sigev_signo,
99   - aiocb->aio_sigevent.sigev_value);
  97 + kill(getpid(), aiocb->sigev_signo);
100 98 }
101 99  
102 100 idle_threads--;
... ...
posix-aio-compat.h
... ... @@ -29,7 +29,7 @@ struct qemu_paiocb
29 29 int aio_fildes;
30 30 void *aio_buf;
31 31 size_t aio_nbytes;
32   - struct sigevent aio_sigevent;
  32 + int sigev_signo;
33 33 off_t aio_offset;
34 34  
35 35 /* private */
... ...