c - Using select() to detect a block on a UIO device file -
i'm working on embedded processor running yocto. have modified uio_pdrv_genirq.c uio driver. i writing library control dma. there 1 function writes device file , initiates dma. second function intended wait dma complete calling select() . whilst dma in progress device file blocks. on completion dma controller issues interrupt releases block on device file. i have system working expected using read() want switch select() can include time out. however, when use select() , doesn't seem recognising block , returns (before dma has completed). have included simple version of code: int gannet_dma_interrupt_wait(dma_device_t *dma_device, dma_direction dma_transfer_direction) { fd_set rfds; struct timeval timeout; int select_res; /* initialize file descriptor set , add device file */ fd_zero(&rfds); fd_set(dma_device->fd, &rfds); /* set timeout period. */ timeout.tv_sec = 5; timeout.tv_usec = 0; /* device file b...