Commit c9db92fcc1c512b9e0e9928c0f2ac7a74b9cf384
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
Showing
4 changed files
with
4 additions
and
9 deletions
block-raw-posix.c
| @@ -579,8 +579,7 @@ static RawAIOCB *raw_aio_setup(BlockDriverState *bs, | @@ -579,8 +579,7 @@ static RawAIOCB *raw_aio_setup(BlockDriverState *bs, | ||
| 579 | if (!acb) | 579 | if (!acb) |
| 580 | return NULL; | 580 | return NULL; |
| 581 | acb->aiocb.aio_fildes = s->fd; | 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 | acb->aiocb.aio_buf = buf; | 583 | acb->aiocb.aio_buf = buf; |
| 585 | if (nb_sectors < 0) | 584 | if (nb_sectors < 0) |
| 586 | acb->aiocb.aio_nbytes = -nb_sectors; | 585 | acb->aiocb.aio_nbytes = -nb_sectors; |
configure
| @@ -1005,9 +1005,7 @@ if test "$aio" = "yes" ; then | @@ -1005,9 +1005,7 @@ if test "$aio" = "yes" ; then | ||
| 1005 | aio=no | 1005 | aio=no |
| 1006 | cat > $TMPC << EOF | 1006 | cat > $TMPC << EOF |
| 1007 | #include <pthread.h> | 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 | EOF | 1009 | EOF |
| 1012 | if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then | 1010 | if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then |
| 1013 | aio=yes | 1011 | aio=yes |
posix-aio-compat.c
| @@ -94,9 +94,7 @@ static void *aio_thread(void *unused) | @@ -94,9 +94,7 @@ static void *aio_thread(void *unused) | ||
| 94 | idle_threads++; | 94 | idle_threads++; |
| 95 | pthread_mutex_unlock(&lock); | 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 | idle_threads--; | 100 | idle_threads--; |
posix-aio-compat.h
| @@ -29,7 +29,7 @@ struct qemu_paiocb | @@ -29,7 +29,7 @@ struct qemu_paiocb | ||
| 29 | int aio_fildes; | 29 | int aio_fildes; |
| 30 | void *aio_buf; | 30 | void *aio_buf; |
| 31 | size_t aio_nbytes; | 31 | size_t aio_nbytes; |
| 32 | - struct sigevent aio_sigevent; | 32 | + int sigev_signo; |
| 33 | off_t aio_offset; | 33 | off_t aio_offset; |
| 34 | 34 | ||
| 35 | /* private */ | 35 | /* private */ |