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
This commit is contained in:
		
							parent
							
								
									63c75dcd66
								
							
						
					
					
						commit
						c9db92fcc1
					
				| 
						 | 
					@ -579,8 +579,7 @@ static RawAIOCB *raw_aio_setup(BlockDriverState *bs,
 | 
				
			||||||
    if (!acb)
 | 
					    if (!acb)
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    acb->aiocb.aio_fildes = s->fd;
 | 
					    acb->aiocb.aio_fildes = s->fd;
 | 
				
			||||||
    acb->aiocb.aio_sigevent.sigev_signo = SIGUSR2;
 | 
					    acb->aiocb.sigev_signo = SIGUSR2;
 | 
				
			||||||
    acb->aiocb.aio_sigevent.sigev_notify = SIGEV_SIGNAL;
 | 
					 | 
				
			||||||
    acb->aiocb.aio_buf = buf;
 | 
					    acb->aiocb.aio_buf = buf;
 | 
				
			||||||
    if (nb_sectors < 0)
 | 
					    if (nb_sectors < 0)
 | 
				
			||||||
        acb->aiocb.aio_nbytes = -nb_sectors;
 | 
					        acb->aiocb.aio_nbytes = -nb_sectors;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1005,9 +1005,7 @@ if test "$aio" = "yes" ; then
 | 
				
			||||||
  aio=no
 | 
					  aio=no
 | 
				
			||||||
  cat > $TMPC << EOF
 | 
					  cat > $TMPC << EOF
 | 
				
			||||||
#include <pthread.h>
 | 
					#include <pthread.h>
 | 
				
			||||||
#include <signal.h>
 | 
					int main(void) { pthread_mutex_t lock;  return 0; }
 | 
				
			||||||
int main(void) { struct sigevent s; pthread_mutex_t lock;
 | 
					 | 
				
			||||||
    return sigqueue(0, 0, s.sigev_value); }
 | 
					 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
  if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
 | 
					  if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
 | 
				
			||||||
    aio=yes
 | 
					    aio=yes
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,9 +94,7 @@ static void *aio_thread(void *unused)
 | 
				
			||||||
        idle_threads++;
 | 
					        idle_threads++;
 | 
				
			||||||
        pthread_mutex_unlock(&lock);
 | 
					        pthread_mutex_unlock(&lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sigqueue(getpid(),
 | 
					        kill(getpid(), aiocb->sigev_signo);
 | 
				
			||||||
                 aiocb->aio_sigevent.sigev_signo,
 | 
					 | 
				
			||||||
                 aiocb->aio_sigevent.sigev_value);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    idle_threads--;
 | 
					    idle_threads--;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ struct qemu_paiocb
 | 
				
			||||||
    int aio_fildes;
 | 
					    int aio_fildes;
 | 
				
			||||||
    void *aio_buf;
 | 
					    void *aio_buf;
 | 
				
			||||||
    size_t aio_nbytes;
 | 
					    size_t aio_nbytes;
 | 
				
			||||||
    struct sigevent aio_sigevent;
 | 
					    int sigev_signo;
 | 
				
			||||||
    off_t aio_offset;
 | 
					    off_t aio_offset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* private */
 | 
					    /* private */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue