$NetBSD: patch-ah,v 1.1.1.1 2008/09/09 11:50:18 jmcneill Exp $ --- cpi/v4l2cpi/v4l2.c.orig 2008-10-03 12:20:06.000000000 -0400 +++ cpi/v4l2cpi/v4l2.c @@ -43,8 +43,12 @@ #include #include +#ifdef __linux__ #include #include +#elif defined(__NetBSD__) +#include +#endif #include "v4l2.h" #include "tisuvccam.h" @@ -2396,11 +2400,15 @@ static void v4l2_capture_thread( v4l2_ha old_index = handle->dqindex; +#ifdef __NetBSD__ + sem_wait( &handle->sema ); +#else if( sem_timedwait( &handle->sema, &abs_timeout ) ) { TRACE( "SEM_WAIT FAILED\n" ); continue; } +#endif if( ( ( handle->dqindex + 1 ) % handle->buffer_count ) == handle->qindex ) { @@ -2503,7 +2511,11 @@ static void v4l2_capture_thread( v4l2_ha if( handle->io_method == CPI_V4L2_IO_METHOD_MMAP ) { +#ifdef __NetBSD__ + while( sem_wait( &handle->sema ) ) +#else while( sem_timedwait( &handle->sema, &abs_timeout ) ) +#endif { TRACE( "SEM_WAIT FAILED!\n" ); gettimeofday( &ctime, NULL );